From 9d5667eb0045f7a0242631dfbd52ba2fdc431290 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Fri, 3 Aug 2018 15:55:21 +0300 Subject: [PATCH] fix(closing): window can be closing on event --- src/background/background.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/background/background.js b/src/background/background.js index fd0d124..a6c567b 100644 --- a/src/background/background.js +++ b/src/background/background.js @@ -266,7 +266,8 @@ app.on("ready", () => { { const id = arg[arg.length - 1].callback arg[arg.length - 1] = (responce) => { - mainWindow.webContents.send('callback', id, responce) + if(mainWindow) + mainWindow.webContents.send('callback', id, responce) } } callback.apply(null, arg)