From 12a51eed897135f331fc8a27515ba185f605ef44 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 15 Feb 2018 14:05:01 -0500 Subject: [PATCH] fix null ref --- src/main/window.main.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/window.main.ts b/src/main/window.main.ts index 1cbb7c01e4..68e778d30d 100644 --- a/src/main/window.main.ts +++ b/src/main/window.main.ts @@ -123,7 +123,7 @@ export class WindowMain { private windowStateChangeHandler(configKey: string, win: BrowserWindow) { global.clearTimeout(this.windowStateChangeTimer); - this.windowStateChangeTimer = setTimeout(async () => { + this.windowStateChangeTimer = global.setTimeout(async () => { await this.updateWindowState(configKey, win); }, WindowEventHandlingDelay); } @@ -183,11 +183,13 @@ export class WindowMain { } } - if (state.width > displayBounds.width) { - state.width = displayBounds.width; - } - if (state.height > displayBounds.height) { - state.height = displayBounds.height; + if (displayBounds != null) { + if (state.width > displayBounds.width) { + state.width = displayBounds.width; + } + if (state.height > displayBounds.height) { + state.height = displayBounds.height; + } } return state;