Handle exception when closing window

- Prevents showing an error if someone tries to close a window with shortcut key if there is no window opened in macOS
This commit is contained in:
Agampreet Singh
2023-12-24 23:03:19 +05:30
parent 6ff03b85b9
commit 62932046e4

View File

@@ -759,7 +759,11 @@ const menulayout = [
label: "Close Window",
accelerator: "CmdOrCtrl+W",
click: () => {
BrowserWindow.getFocusedWindow().close();
try {
BrowserWindow.getFocusedWindow().close();
} catch {
return;
}
},
},
{