From 4e35f9f290cb0af04b8961ffc60427ca3845b10e Mon Sep 17 00:00:00 2001 From: lwouis Date: Sun, 23 Feb 2025 21:06:13 +0100 Subject: [PATCH] fix: prevent rare crash --- src/logic/Application.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logic/Application.swift b/src/logic/Application.swift index 6c4e641e..61faec60 100644 --- a/src/logic/Application.swift +++ b/src/logic/Application.swift @@ -71,7 +71,7 @@ class Application: NSObject { AXUIElement.retryAxCallUntilTimeout(timeoutInSeconds: 5) { [weak self] in guard let self else { return } var atLeastOneActualWindow = false - let axWindows = try self.axUiElement!.allWindows(self.pid) + guard let axWindows = try self.axUiElement?.allWindows(self.pid) else { return } for axWindow in axWindows { if let wid = try axWindow.cgWindowId(), let (title, role, subrole, isMinimized, isFullscreen) = try axWindow.windowAttributes() {