File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -343,12 +343,22 @@ class Worker extends EventEmitter {
343
343
case messageTypes . STDIO_PAYLOAD :
344
344
{
345
345
const { stream, chunk, encoding } = message ;
346
- return this [ kParentSideStdio ] [ stream ] . push ( chunk , encoding ) ;
346
+ if ( this [ kParentSideStdio ] ) {
347
+ this [ kParentSideStdio ] [ stream ] . push ( chunk , encoding ) ;
348
+ } else {
349
+ debug ( `[${ threadId } ] explicitly closes stdout for ${ this . threadId } ` ) ;
350
+ }
351
+ return ;
347
352
}
348
353
case messageTypes . STDIO_WANTS_MORE_DATA :
349
354
{
350
355
const { stream } = message ;
351
- return this [ kParentSideStdio ] [ stream ] [ kStdioWantsMoreDataCallback ] ( ) ;
356
+ if ( this [ kParentSideStdio ] ) {
357
+ this [ kParentSideStdio ] [ stream ] [ kStdioWantsMoreDataCallback ] ( ) ;
358
+ } else {
359
+ debug ( `[${ threadId } ] explicitly closes stdout for ${ this . threadId } ` ) ;
360
+ }
361
+ return ;
352
362
}
353
363
}
354
364
You can’t perform that action at this time.
0 commit comments