Skip to content

Commit

Permalink
fs: return null error on readFile() success
Browse files Browse the repository at this point in the history
This commit ensures that readFile() callsback with a null
error consistently on success.

PR-URL: #3740
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
  • Loading branch information
zbinlin authored and rvagg committed Nov 13, 2015
1 parent 47f3735 commit 2aa6a6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ function readFileAfterClose(err) {
}

function tryToString(buf, encoding, callback) {
var e;
var e = null;
try {
buf = buf.toString(encoding);
} catch (err) {
Expand Down

0 comments on commit 2aa6a6d

Please sign in to comment.