From 90bc9e91905be0e790a6cd2d59f64e35de9ca858 Mon Sep 17 00:00:00 2001 From: Farooq Karimi Zadeh Date: Mon, 31 Jul 2023 14:35:23 +0330 Subject: [PATCH] solve problem of exceptions on quit. fix #2201 --- CHANGELOG.md | 1 + src/main/windows/main.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55df39b476..3d99307fce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - fix: Fix colour of clock icon in ViewProfile dialogue (#3329) - fix: Center the "no media" text in Gallery - fix: The media fullscreen screen is now always closed using Esc key(#2919) +- fix: Fix problem of returning exception on quit (#2201) diff --git a/src/main/windows/main.ts b/src/main/windows/main.ts index b87df75d15..5fbff960a3 100644 --- a/src/main/windows/main.ts +++ b/src/main/windows/main.ts @@ -159,6 +159,10 @@ export function send(channel: string, ...args: any[]) { log.warn("window not defined, can't send ipc to renderer") return } + if (window.webContents.isDestroyed()) { + log.warn('window.webContents is destroyed. not sending message') + return + } try { window.webContents.send(channel, ...args) } catch (error) {