diff --git a/app/main.ts b/app/main.ts index 2cd1773fd2..595a5ef81e 100644 --- a/app/main.ts +++ b/app/main.ts @@ -694,8 +694,13 @@ async function safeLoadURL(window: BrowserWindow, url: string): Promise { } throw error; } finally { - window.webContents.removeListener('did-stop-loading', onDestroyed); - window.webContents.removeListener('destroyed', onDestroyed); + try { + window.webContents.removeListener('did-stop-loading', onDestroyed); + window.webContents.removeListener('destroyed', onDestroyed); + } catch { + // We already logged or thrown an error - don't bother with handling the + // error here. + } } }