Check if view is destroyed before sending ipc message (#2505)
This commit is contained in:
parent
c8c88a274f
commit
5bafaff297
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -13,6 +13,7 @@
|
|||
"chromedriver",
|
||||
"chromedriverlog",
|
||||
"deauthorize",
|
||||
"deeplink",
|
||||
"deeplinking",
|
||||
"diskimage",
|
||||
"dont",
|
||||
|
|
|
@ -549,6 +549,10 @@ export class ViewManager {
|
|||
};
|
||||
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue