diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 748f14a283f05f..095d44e0f1801d 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -247,6 +247,13 @@ function stdioStringToArray(stdio, channel) { throw new ERR_INVALID_ARG_VALUE('stdio', stdio); } + for (let i = 0; i < options.length; i++) { + const stream = options[i]; + if (stream == null) { + throw new ERR_INVALID_ARG_VALUE('stdio', options); + } + } + if (channel) ArrayPrototypePush(options, channel); return options;