From 69ad832a39eda5ded884b965928c93cb85b8aebf Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sat, 14 Dec 2024 22:09:38 +0100 Subject: [PATCH] fix(App): Fix crash on logout --- src/electron/ipc-api/browserViewManager.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/electron/ipc-api/browserViewManager.ts b/src/electron/ipc-api/browserViewManager.ts index 4370b780..4e75ce4f 100644 --- a/src/electron/ipc-api/browserViewManager.ts +++ b/src/electron/ipc-api/browserViewManager.ts @@ -289,7 +289,7 @@ export default async ({ mainWindow, settings: { app: settings } }: { mainWindow: ipcMain.on(IPC.TODOS_CLIENT_CHANNEL, (event, data) => { debug('Received client IPC message from Todos', data); - mainWindow.webContents.send(IPC.TODOS_CLIENT_CHANNEL, data); + mainWindow?.webContents.send(IPC.TODOS_CLIENT_CHANNEL, data); }); ipcMain.on(IPC.TODOS_HOST_CHANNEL, (event, data) => { @@ -298,10 +298,10 @@ export default async ({ mainWindow, settings: { app: settings } }: { mainWindow: if (data.action === 'todos:toggleDevTools') { if (todosService) { - todosService.webContents.toggleDevTools(); + todosService?.webContents.toggleDevTools(); } } else { - todosService.webContents.send(IPC.TODOS_HOST_CHANNEL, data); + todosService?.webContents.send(IPC.TODOS_HOST_CHANNEL, data); } });