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>
v5.x
Zheng Chaoping 9 years ago
committed by Rod Vagg
parent
commit
2aa6a6d998
  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