From 87dc9b8ba280cb42669ea960f49e19276170eebf Mon Sep 17 00:00:00 2001 From: Marquis Kurt Date: Fri, 17 May 2019 11:47:22 -0400 Subject: [PATCH] Reload the window only if it's open --- public/electron.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/electron.js b/public/electron.js index dde4c93..90f8cc5 100644 --- a/public/electron.js +++ b/public/electron.js @@ -138,7 +138,8 @@ function createWindow() { // Watch for a change in macOS's dark mode and reload the window to apply changes systemPreferences.subscribeNotification('AppleInterfaceThemeChangedNotification', () => { - mainWindow.webContents.reload(); + if (mainWindow != null) + mainWindow.webContents.reload(); }) // Delete the window when closed