Skip to content

Commit 7a31575

Browse files
child_process: handles options === null
refs: nodejs#20749
1 parent a0d6b15 commit 7a31575

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/child_process.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,20 @@ function normalizeForkArguments(args, options) {
6666
args === null ||
6767
typeof args !== 'object')
6868
) {
69-
throw new ERR_INVALID_ARG_TYPE('args', 'array', args);
69+
// throw new ERR_INVALID_ARG_TYPE('args', 'object', args);
70+
args = [];
7071
} else {
7172
options = args;
7273
args = [];
7374
}
7475

75-
if (options === undefined)
76+
if (options === undefined) {
7677
options = {};
77-
else if (options === null || typeof options !== 'object')
78+
} else if (typeof options !== 'object') {
7879
throw new ERR_INVALID_ARG_TYPE('options', 'object', options);
80+
} else {
81+
options = {};
82+
}
7983

8084
return {
8185
args,

0 commit comments

Comments
 (0)