From f64e9ab0482c0bb00ef3dbba374ac4670227b764 Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Wed, 8 Jan 2025 09:56:05 -0500 Subject: [PATCH] [MM-62395] Don't attempt to set boundaries for a window that is no longer attached (#3278) Co-authored-by: Mattermost Build --- src/main/views/modalView.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/views/modalView.ts b/src/main/views/modalView.ts index f5825ca8269..4ba8efb0c23 100644 --- a/src/main/views/modalView.ts +++ b/src/main/views/modalView.ts @@ -66,7 +66,9 @@ export class ModalView { // Linux sometimes doesn't have the bound initialized correctly initially, so we wait to set them const setBoundsFunction = () => { - this.view.setBounds(getWindowBoundaries(this.windowAttached!)); + if (this.windowAttached) { + this.view.setBounds(getWindowBoundaries(this.windowAttached)); + } }; if (process.platform === 'linux') { setTimeout(setBoundsFunction, 10);