Commit a01fa104 authored by nanahira's avatar nanahira

fix empty content

parent 095a178d
...@@ -41,8 +41,8 @@ module.exports = function readFile(filename, options, cb) { ...@@ -41,8 +41,8 @@ module.exports = function readFile(filename, options, cb) {
var callback = function(offset) { var callback = function(offset) {
return function(err, content) { return function(err, content) {
if (stop) return; if (stop) return;
if (err) { if (err || !content) {
cb && cb(err); cb && cb(err || new Error('Empty content'));
stop = true; stop = true;
} else { } else {
content.copy(result, offset.toNumber()); 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