avoid sending messages to disconnected processes

This commit is contained in:
Iuri Matias 2018-06-06 10:42:06 -04:00
parent f44ed981b5
commit 2c2540417c
1 changed files with 6 additions and 0 deletions

View File

@ -66,10 +66,16 @@ class ProcessWrapper {
if (isHardSource) { if (isHardSource) {
return; return;
} }
if (!process.connected) {
return;
}
process.send({result: constants.process.log, message: messages, type}); process.send({result: constants.process.log, message: messages, type});
} }
send() { send() {
if (!process.connected) {
return;
}
process.send(...arguments); process.send(...arguments);
} }