From eb6252f443798a211cf8e639a8bf11279daf4054 Mon Sep 17 00:00:00 2001 From: Nick Mitchell Date: Mon, 25 Jul 2022 14:16:40 -0400 Subject: [PATCH] fix(packages/core): ctrl/cmd+w can result in null pointer exception --- packages/core/src/main/menu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/main/menu.ts b/packages/core/src/main/menu.ts index 4b9bf80808d..c910117b5e1 100644 --- a/packages/core/src/main/menu.ts +++ b/packages/core/src/main/menu.ts @@ -48,7 +48,7 @@ const closeTab = ( _: import('electron').MenuItem, browserWindow: import('electron').BrowserWindow & { subwindow: ISubwindowPrefs } ) => { - if (browserWindow.subwindow && browserWindow.subwindow._notAKuiWindow) { + if (browserWindow && browserWindow.subwindow && browserWindow.subwindow._notAKuiWindow) { browserWindow.close() } else { tellRendererToExecute('tab close -A')