From 2402a66a83d23df047231d8477ae685f87250450 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 15 Feb 2018 09:24:11 +0100 Subject: [PATCH] ipc: safe flush --- app/main/ipc/client.js | 2 +- src/browser/js/app/ipc/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main/ipc/client.js b/app/main/ipc/client.js index 7adc0e89..b815253e 100644 --- a/app/main/ipc/client.js +++ b/app/main/ipc/client.js @@ -104,7 +104,7 @@ class Socket extends EventEmitter { for (var i in this.queue) { - this.socket.send(this.queue[i]) + if (this.connected()) this.socket.send(this.queue[i]) } diff --git a/src/browser/js/app/ipc/index.js b/src/browser/js/app/ipc/index.js index 56d5af39..26b3721f 100644 --- a/src/browser/js/app/ipc/index.js +++ b/src/browser/js/app/ipc/index.js @@ -126,7 +126,7 @@ class Ipc extends EventEmitter { for (var i in this.queue) { - this.socket.send(this.queue[i]) + if (this.connected()) this.socket.send(this.queue[i]) }