Skip to content

Commit 71f1293

Browse files
erikkempermanphated
authored andcommitted
Update: Invoke callback with error or result, not both, when reading contents (#259)
1 parent 5ba4be3 commit 71f1293

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/read-contents/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ function readContents(optResolver) {
3939
// This is invoked by the various readXxx modules when they've finished
4040
// reading the contents.
4141
function onRead(readErr) {
42-
callback(readErr, file);
42+
if (readErr) {
43+
return callback(readErr);
44+
}
45+
return callback(null, file);
4346
}
4447
}
4548

0 commit comments

Comments
 (0)