Skip to content

child_process: add safety checks on stdio access

Rodrigo Muino Tomonari requested to merge github/fork/cjihrig/stdio-checks into master

When a child process is spawned, there is no guarantee that stdout and stderr will be created successfully. This commit adds checks before attempting to access the streams.

This is related to https://github.com/nodejs/node/issues/1321. It prevents Node from synchronously throwing TypeError: Cannot read property 'addListener' of undefined. Instead, an async error, EAGAIN is provided to the callback.

Merge request reports

Loading