Skip to content

Commit 71dddeb

Browse files
Add try/catch around sending event to all windows to prevent windows disappearing throwing.
1 parent 6230e6e commit 71dddeb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

gui-js/apps/minsky-electron/src/app/managers/WindowManager.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,11 @@ export class WindowManager {
374374

375375
static refreshAllGodleyPopups() {
376376
for (const win of WindowManager.activeWindows.values())
377-
if (win.context!=WindowManager.getMainWindow())
378-
win.context?.webContents?.send(events.GODLEY_POPUP_REFRESH);
377+
if (win.context!=WindowManager.getMainWindow()) {
378+
try {
379+
win.context?.webContents?.send(events.GODLEY_POPUP_REFRESH);
380+
}
381+
catch (err) {} // absorb any exceptions due to windows disappearing
382+
}
379383
}
380384
}

0 commit comments

Comments
 (0)