From 2c2540417cc41e82a4011d2f65437491a1e1b8ef Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 6 Jun 2018 10:42:06 -0400 Subject: [PATCH 1/2] avoid sending messages to disconnected processes --- lib/process/processWrapper.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/process/processWrapper.js b/lib/process/processWrapper.js index 9b4fbe1d..6f7e207a 100644 --- a/lib/process/processWrapper.js +++ b/lib/process/processWrapper.js @@ -66,10 +66,16 @@ class ProcessWrapper { if (isHardSource) { return; } + if (!process.connected) { + return; + } process.send({result: constants.process.log, message: messages, type}); } send() { + if (!process.connected) { + return; + } process.send(...arguments); } From ab20b10d5dcc7fef799947347eccadf9884f9d77 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 6 Jun 2018 11:09:06 -0400 Subject: [PATCH 2/2] use existing process send to avoid the extra if --- lib/process/processWrapper.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/process/processWrapper.js b/lib/process/processWrapper.js index 6f7e207a..6096d9e5 100644 --- a/lib/process/processWrapper.js +++ b/lib/process/processWrapper.js @@ -66,10 +66,7 @@ class ProcessWrapper { if (isHardSource) { return; } - if (!process.connected) { - return; - } - process.send({result: constants.process.log, message: messages, type}); + this.send({result: constants.process.log, message: messages, type}); } send() {