diff --git a/src/main/index.js b/src/main/index.js index 17b6361b7..9b7b22f77 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 => { @@ -120,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