From 6327c761f783798cd1a258276235b7c49309bb14 Mon Sep 17 00:00:00 2001 From: PalmerAL Date: Thu, 7 Mar 2024 06:33:41 -0600 Subject: [PATCH] ignore IPC messages from views when the parent window has been destroyed --- main/viewManager.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main/viewManager.js b/main/viewManager.js index 549f12837..f2abfd76c 100644 --- a/main/viewManager.js +++ b/main/viewManager.js @@ -138,6 +138,11 @@ function createView (existingViewId, id, webPreferences, boundsString, events) { const eventTarget = BrowserWindow.fromBrowserView(view) || windows.getCurrent() + if (!eventTarget) { + //this can happen during shutdown - windows can be destroyed before the corresponding views, and the view can emit an event during that time + return + } + eventTarget.webContents.send('view-ipc', { id: id, name: channel,