Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Invoke callback with error or result, not both, when reading …
Browse files Browse the repository at this point in the history
…contents (#259)
erikkemperman authored and phated committed Nov 27, 2017
1 parent 8ea5812 commit 636e77e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/read-contents/index.js
Original file line number Diff line number Diff line change
@@ -39,7 +39,10 @@ function readContents(optResolver) {
// This is invoked by the various readXxx modules when they've finished
// reading the contents.
function onRead(readErr) {
callback(readErr, file);
if (readErr) {
return callback(readErr);
}
return callback(null, file);
}
}

0 comments on commit 636e77e

Please sign in to comment.