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>
This commit is contained in:
parent
f299d870dc
commit
1594198600
@ -405,7 +405,7 @@ function readFileAfterClose(err) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function tryToString(buf, encoding, callback) {
|
function tryToString(buf, encoding, callback) {
|
||||||
var e;
|
var e = null;
|
||||||
try {
|
try {
|
||||||
buf = buf.toString(encoding);
|
buf = buf.toString(encoding);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user