Commit 7069fbc
committed
fix: check if the socket exists in the worker
Reference: https://nodejs.org/api/child_process.html#child_process_example_sending_a_socket_object
> Any 'message' handlers in the subprocess should verify that socket
exists, as the connection may have been closed during the time it takes
to send the connection to the child.
Without this check, the following exception could be thrown:
internal/per_context/primordials.js:23
return (thisArg, ...args) => ReflectApply(func, thisArg, args);
^
TypeError: Cannot convert undefined or null to object
at hasOwnProperty (<anonymous>)
at internal/per_context/primordials.js:23:32
at getOrSetAsyncId (internal/async_hooks.js:396:7)
at Server.connectionListener (_http_server.js:414:5)
at Server.emit (events.js:315:20)
Related: #11 parent ad38b06 commit 7069fbc
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
| |||
0 commit comments