Unverified Commit f3cf8e98 authored by Brian White's avatar Brian White
Browse files

fs: do not pass Buffer when toString() fails

Even though an Error object is passed to the callback when readFile()
fails due to toString() failing, it is a bit strange to still see
data passed as the second argument. This commit changes that and only
passes the Error object in that case.

PR-URL: https://github.com/nodejs/node/pull/9670


Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarSakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: default avatarPrince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 4f97a146
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment