Skip to content

Commit

Permalink
Handle exception when closing window
Browse files Browse the repository at this point in the history
- Prevents showing an error if someone tries to close a window with shortcut key if there is no window opened in macOS
  • Loading branch information
agam778 committed Dec 24, 2023
1 parent b49931b commit 750c510
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,11 @@ const menulayout = [
label: "Close Window",
accelerator: "CmdOrCtrl+W",
click: () => {
BrowserWindow.getFocusedWindow().close();
try {
BrowserWindow.getFocusedWindow().close();
} catch {
return;
}
},
},
{
Expand Down

0 comments on commit 750c510

Please sign in to comment.