1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix 'cannot read property hide of null' error on quit

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-12-01 15:02:56 +02:00
parent 832f29f666
commit 0e4c3e507d
2 changed files with 5 additions and 5 deletions

View File

@ -9,10 +9,10 @@ export function exitApp() {
const windowManager = WindowManager.getInstance<WindowManager>();
const clusterManager = ClusterManager.getInstance<ClusterManager>();
appEventBus.emit({ name: "service", action: "close" });
windowManager.hide();
clusterManager.stop();
windowManager?.hide();
clusterManager?.stop();
logger.info("SERVICE:QUIT");
setTimeout(() => {
app.exit();
}, 1000);
}
}

View File

@ -158,8 +158,8 @@ export class WindowManager extends Singleton {
}
hide() {
if (!this.mainWindow?.isDestroyed()) this.mainWindow.hide();
if (!this.splashWindow.isDestroyed()) this.splashWindow.hide();
if (this.mainWindow && !this.mainWindow.isDestroyed()) this.mainWindow.hide();
if (this.splashWindow && !this.splashWindow.isDestroyed()) this.splashWindow.hide();
}
destroy() {