fix: occasional crash when no there are no open window (closes #459)

This commit is contained in:
Louis Pontoise authored and lwouis committed 2020-07-22 23:19:45 +09:00
1 parent a8970ddf71
commit 6df92da76f
1 file changed
+7 -6
+7 -6
View File
@@ -116,12 +116,13 @@ class Windows {
} }
static func checkIfShortcutsShouldBeDisabled() { static func checkIfShortcutsShouldBeDisabled() {
let activeWindow = list[0] if let activeWindow = list.first {
App.app.shortcutsShouldBeDisabled = App.app.shortcutsShouldBeDisabled =
Preferences.disableShortcutsBlacklist.contains(activeWindow.application.runningApplication.bundleIdentifier ?? "") && Preferences.disableShortcutsBlacklist.contains(activeWindow.application.runningApplication.bundleIdentifier ?? "") &&
(!Preferences.disableShortcutsBlacklistOnlyFullscreen || activeWindow.isFullscreen) (!Preferences.disableShortcutsBlacklistOnlyFullscreen || activeWindow.isFullscreen)
if App.app.shortcutsShouldBeDisabled && App.app.appIsBeingUsed { if App.app.shortcutsShouldBeDisabled && App.app.appIsBeingUsed {
App.app.hideUi() App.app.hideUi()
}
} }
} }
} }