Browse Source

fs: return null error on readFile() success

This commit ensures that readFile() callsback with a null
error consistently on success.

PR-URL: https://github.com/nodejs/node/pull/3740
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
process-exit-stdio-flushing
Zheng Chaoping 9 years ago
committed by cjihrig
parent
commit
1594198600
  1. 2
      lib/fs.js

2
lib/fs.js

@ -405,7 +405,7 @@ function readFileAfterClose(err) {
}
function tryToString(buf, encoding, callback) {
var e;
var e = null;
try {
buf = buf.toString(encoding);
} catch (err) {

Loading…
Cancel
Save