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 (#1594)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-12-03 14:55:19 +02:00 committed by GitHub
parent 432b00b8cc
commit ac35bab987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -10,10 +10,10 @@ export function exitApp() {
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();
}, 1000); }, 1000);
} }

View File

@ -163,8 +163,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() {