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,