From d8c87994060a28172d828792ec280932bfd29af6 Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Mon, 14 Jan 2019 17:12:46 +0100 Subject: [PATCH] Don't send events after window is gone --- events/EventBus.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/events/EventBus.ts b/events/EventBus.ts index af9e89d..e821550 100644 --- a/events/EventBus.ts +++ b/events/EventBus.ts @@ -28,7 +28,9 @@ class IpcMainEventBus implements EventBusInterface { } public emit(event: Event, msg: MessageType) { - this.client.send(event.topic, msg) + if (!this.client.isDestroyed()) { + this.client.send(event.topic, msg) + } } }