Commit a01fa104 authored by nanahira's avatar nanahira

fix empty content

parent 095a178d
......@@ -41,8 +41,8 @@ module.exports = function readFile(filename, options, cb) {
var callback = function(offset) {
return function(err, content) {
if (stop) return;
if (err) {
cb && cb(err);
if (err || !content) {
cb && cb(err || new Error('Empty content'));
stop = true;
} else {
content.copy(result, offset.toNumber());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment