coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.81k stars 356 forks source link

Error when attempting to kill child process. #214

Closed dsbert closed 4 years ago

dsbert commented 6 years ago

I"m seeing the following error printed in the wrapper logs. It looks like a null check is not happening.

E:\wrapper.js:177
    child.send('shutdown');
          ^

TypeError: Cannot read property 'send' of null
    at process.killkid (E:\wrapper.js:177:11)
    at process.emit (events.js:160:13)
    at process.exit (internal/process.js:147:15)
    at monitor (E:\wrapper.js:99:17)
    at ChildProcess.<anonymous> (E:\wrapper.js:170:5)
    at ChildProcess.emit (events.js:160:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
coreybutler commented 6 years ago

I've added a check with some logging/warnings, because this method really shouldn't be called unless the child process refuses to exit. This fix is only available in master, it has not been published to npm.

dsbert commented 6 years ago

Thanks, I'll take a look

coreybutler commented 4 years ago

New version released.