fix: prevent rare crash

This commit is contained in:
lwouis committed 2025-02-23 21:06:22 +01:00
1 parent 820b6ea3aa
commit 4e35f9f290
1 file changed
+1 -1
+1 -1
View File
@@ -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() {