Skip to content

Commit 42ae5f5

Browse files
horymuryhristoterezov
authored andcommitted
alwaysontop/renderer(fix): Prevent crash when handling new browser window
1 parent fd05a9b commit 42ae5f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

alwaysontop/render.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ class AlwaysOnTop extends EventEmitter {
241241
*/
242242
_onNewAlwaysOnTopBrowserWindow(windowId) {
243243
this._alwaysOnTopBrowserWindow = remote.BrowserWindow.fromId(windowId);
244+
if (!this._alwaysOnTopBrowserWindow || this._alwaysOnTopBrowserWindow.isDestroyed()){
245+
return;
246+
}
247+
244248
const { webContents } = this._alwaysOnTopBrowserWindow;
245249
// if the window is still loading we may end up loosing the injected content when load finishes. We need to wait
246250
// for the loading to be completed. We are using the browser windows events instead of the DOM window ones because

0 commit comments

Comments
 (0)