child_process: Check stderr before accessing it
Checklist
-
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
child_process
Description of change
If something bad happens in spawnSync, stderr might be null. Therefore, we have to check it before using it, so we won't mask the actual exception.
PR-URL: https://github.com/nodejs/node/pull/6877 Reviewed-By: Colin Ihrig cjihrig@gmail.com Reviewed-By: Robert Jefe Lindstädt robert.lindstaedt@gmail.com Reviewed-By: James M Snell jasnell@gmail.com Reviewed-By: Ben Noordhuis info@bnoordhuis.nl Reviewed-By: Jeremiah Senkpiel fishrock123@rocketmail.com