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 <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
zbinlin authored and cjihrig committed Nov 11, 2015
1 parent f299d87 commit 1594198
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 1594198

Please sign in to comment.