diff --git a/alt-tab-macos/logic/Application.swift b/alt-tab-macos/logic/Application.swift index 5f06dca1..edc2fcca 100644 --- a/alt-tab-macos/logic/Application.swift +++ b/alt-tab-macos/logic/Application.swift @@ -76,7 +76,7 @@ private func axObserverCallback(observer: AXObserver, element: AXUIElement, noti let application = Unmanaged.fromOpaque(applicationPointer!).takeUnretainedValue() let app = App.shared as! App let type = notificationName as String - debugPrint("OS event: " + type, element.title()) + debugPrint("OS event: " + type, element.title() ?? "nil") switch type { case kAXApplicationActivatedNotification: eventApplicationActivated(app, element) case kAXApplicationHiddenNotification, kAXApplicationShownNotification: eventApplicationHiddenOrShown(app, element, type) diff --git a/alt-tab-macos/logic/Window.swift b/alt-tab-macos/logic/Window.swift index e6d4edd4..66bb9fa1 100644 --- a/alt-tab-macos/logic/Window.swift +++ b/alt-tab-macos/logic/Window.swift @@ -27,7 +27,7 @@ class Window { self.spaceIndex = Spaces.currentSpaceIndex self.isOnAllSpaces = false self.title = Window.bestEffortTitle(axUiElement, cgWindowId, application) - debugPrint("Adding window: " + title, application.runningApplication.bundleIdentifier, Spaces.currentSpaceId, Spaces.currentSpaceIndex) + debugPrint("Adding window: " + title, application.runningApplication.bundleIdentifier ?? "nil", Spaces.currentSpaceId, Spaces.currentSpaceIndex) observeEvents() } @@ -104,7 +104,7 @@ class Window { private func axObserverCallback(observer: AXObserver, element: AXUIElement, notificationName: CFString, _: UnsafeMutableRawPointer?) -> Void { let type = notificationName as String let app = App.shared as! App - debugPrint("OS event: " + type, element.title()) + debugPrint("OS event: " + type, element.title() ?? "nil") switch type { case kAXUIElementDestroyedNotification: eventWindowDestroyed(app, element) case kAXWindowMiniaturizedNotification, kAXWindowDeminiaturizedNotification: eventWindowMiniaturizedOrDeminiaturized(app, element, type)