Check if view is destroyed before sending ipc message (#2505)
This commit is contained in:
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@@ -13,6 +13,7 @@
|
|||||||
"chromedriver",
|
"chromedriver",
|
||||||
"chromedriverlog",
|
"chromedriverlog",
|
||||||
"deauthorize",
|
"deauthorize",
|
||||||
|
"deeplink",
|
||||||
"deeplinking",
|
"deeplinking",
|
||||||
"diskimage",
|
"diskimage",
|
||||||
"dont",
|
"dont",
|
||||||
|
@@ -549,6 +549,10 @@ export class ViewManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
sendToAllViews = (channel: string, ...args: unknown[]) => {
|
sendToAllViews = (channel: string, ...args: unknown[]) => {
|
||||||
this.views.forEach((view) => view.view.webContents.send(channel, ...args));
|
this.views.forEach((view) => {
|
||||||
|
if (!view.view.webContents.isDestroyed()) {
|
||||||
|
view.view.webContents.send(channel, ...args);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user