Skip to content

Commit 02746a9

Browse files
committed
Merge remote-tracking branch 'origin/main' into 1.29-releases
2 parents 94f51a6 + 8fd35b9 commit 02746a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/hadron-ipc/lib/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ exports.respondTo = (methodName, handler) => {
2424

2525
ipcMain.on(methodName, (event, ...args) => {
2626
const browserWindow = BrowserWindow.fromWebContents(event.sender);
27+
// In rare cases when browserWindow is closed/destroyed before we even had a
28+
// chance to get the reference to it from web contents, browserWindow might
29+
// be null here
30+
if (!browserWindow) {
31+
return;
32+
}
2733
const resolve = (result) => {
2834
debug(`responding with result for ${methodName}`, result);
2935
if (browserWindow.isDestroyed()) {

0 commit comments

Comments
 (0)