From 5831fe18ee4c3868f6bb7db951c5eb3ea912159b Mon Sep 17 00:00:00 2001 From: David Losert Date: Sun, 24 Sep 2023 08:15:38 +0200 Subject: [PATCH] Fix errors with todoist-toggle --- scripts/toggleTodoist.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/toggleTodoist.ts b/scripts/toggleTodoist.ts index fc66ce9..fe1fb6f 100644 --- a/scripts/toggleTodoist.ts +++ b/scripts/toggleTodoist.ts @@ -8,6 +8,11 @@ import { yabai } from '../lib/yabai'; const allWindows = await yabai.queryAllWindows(); const todoistWindow = await yabai.findApp('Todoist', allWindows); + +if(!todoistWindow) { + throw new Error('Todoist window not found'); +} + const focusedWindow = await yabai.findFocusedWindow(allWindows); const allDisplays = await yabai.queryAllDisplays();