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:
@@ -759,7 +759,11 @@ const menulayout = [
|
||||
label: "Close Window",
|
||||
accelerator: "CmdOrCtrl+W",
|
||||
click: () => {
|
||||
BrowserWindow.getFocusedWindow().close();
|
||||
try {
|
||||
BrowserWindow.getFocusedWindow().close();
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user