Skip to content

Commit 0a35ffa

Browse files
committed
fix: Fix crash when Todos view is not initialized
1 parent b791feb commit 0a35ffa

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/electron/ipc-api/browserViewManager.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ export default async ({ mainWindow, settings: { app: settings } }: { mainWindow:
220220
});
221221

222222
ipcMain.on(TODOS_RELOAD, (e) => {
223-
let sbw: IBrowserViewCache;
224-
225223
browserViews.find(browserView => browserView.browserView.isTodos)?.browserView.webContents.reload();
226224
});
227225

@@ -245,7 +243,7 @@ export default async ({ mainWindow, settings: { app: settings } }: { mainWindow:
245243
ipcMain.on(RESIZE_TODO_VIEW, (e, bounds: Rectangle) => {
246244
debug('Resizing todo view by', bounds);
247245

248-
browserViews.find(bw => bw.browserView.isTodos).browserView.resize(bounds);
246+
browserViews.find(bw => bw.browserView.isTodos)?.browserView?.resize(bounds);
249247
});
250248

251249
ipcMain.on(HIDE_ALL_SERVICES, () => {

0 commit comments

Comments
 (0)