From 6c704b5b1c922e7c0aedd6d1d26511765f81772f Mon Sep 17 00:00:00 2001 From: Zheng Chaoping Date: Wed, 11 Nov 2015 00:57:11 +0800 Subject: [PATCH] fs: fix readFile will pass undefined to callback but not null --- lib/fs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fs.js b/lib/fs.js index a009ecae021b68..650ede67af8bae 100644 --- a/lib/fs.js +++ b/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) {