We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 94f51a6 + 8fd35b9 commit 02746a9Copy full SHA for 02746a9
packages/hadron-ipc/lib/main.js
@@ -24,6 +24,12 @@ exports.respondTo = (methodName, handler) => {
24
25
ipcMain.on(methodName, (event, ...args) => {
26
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
+ }
33
const resolve = (result) => {
34
debug(`responding with result for ${methodName}`, result);
35
if (browserWindow.isDestroyed()) {
0 commit comments