Skip to content

Commit

Permalink
Update: Invoke callback with error or result, not both, when reading …
Browse files Browse the repository at this point in the history
…contents (#259)
  • Loading branch information
erikkemperman authored and phated committed Nov 28, 2017
1 parent f53edd2 commit 2ee304d
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
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 2ee304d

Please sign in to comment.