Commit 49d1c366 authored by cjihrig's avatar cjihrig
Browse files

child_process: remove extra newline in errors

checkExecSyncError() creates error objects for execSync() and
execFileSync(). If the child process created stderr output, then
it is attached to the end of the error message. However, stderr
can be an empty Buffer object, which always passes the truthy
check, leading to an extra newline in the error message. This
commit adds a length check, which will work with both strings and
Buffers.

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


Reviewed-By: default avatarWyatt Preul <wpreul@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
parent 0fb21df6
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