Skip to content

Commit 1594198

Browse files
zbinlincjihrig
authored andcommitted
fs: return null error on readFile() success
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]>
1 parent f299d87 commit 1594198

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ function readFileAfterClose(err) {
405405
}
406406

407407
function tryToString(buf, encoding, callback) {
408-
var e;
408+
var e = null;
409409
try {
410410
buf = buf.toString(encoding);
411411
} catch (err) {

0 commit comments

Comments
 (0)