From 12940ac2301f84363e2ffef49fb9e9bc692ef531 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Tue, 3 Jul 2018 00:57:01 -0400 Subject: [PATCH 1/2] Check rendererWindow before calling show --- src/main/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/index.js b/src/main/index.js index 17b6361b7..4b60ce0a1 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -83,7 +83,9 @@ app.on('ready', async () => { }); app.on('activate', () => { - rendererWindow.show(); + if (rendererWindow) { + rendererWindow.show(); + } }); app.on('will-quit', event => { From 37eef522b14eecebf58be163e1ceecf14f2ca580 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Tue, 3 Jul 2018 01:27:47 -0400 Subject: [PATCH 2/2] null rendererwindow window on quit Checking to see if this fixes object has been destroyed error on Mac. --- src/main/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/index.js b/src/main/index.js index 4b60ce0a1..9b7b22f77 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -122,6 +122,10 @@ app.on('will-quit', event => { daemon.quit(); event.preventDefault(); } + + if (rendererWindow) { + rendererWindow = null; + } }); // https://electronjs.org/docs/api/app#event-will-finish-launching