summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/shared')
-rw-r--r--gui/src/shared/ipc-event-channel.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/gui/src/shared/ipc-event-channel.ts b/gui/src/shared/ipc-event-channel.ts
index a11d41bf10..f57368db2d 100644
--- a/gui/src/shared/ipc-event-channel.ts
+++ b/gui/src/shared/ipc-event-channel.ts
@@ -361,13 +361,21 @@ function set<T>(event: string): (value: T) => void {
function sender<T>(event: string): (webContents: WebContents, value: T) => void {
return (webContents: WebContents, value: T) => {
- webContents.send(event, value);
+ if (webContents.isDestroyed()) {
+ log.error(`sender(${event}): webContents is already destroyed!`);
+ } else {
+ webContents.send(event, value);
+ }
};
}
function senderVoid(event: string): (webContents: WebContents) => void {
return (webContents: WebContents) => {
- webContents.send(event);
+ if (webContents.isDestroyed()) {
+ log.error(`senderVoid(${event}): webContents is already destroyed!`);
+ } else {
+ webContents.send(event);
+ }
};
}