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

View File

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