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() {
let activeWindow = list[0]
App.app.shortcutsShouldBeDisabled =
Preferences.disableShortcutsBlacklist.contains(activeWindow.application.runningApplication.bundleIdentifier ?? "") &&
(!Preferences.disableShortcutsBlacklistOnlyFullscreen || activeWindow.isFullscreen)
if App.app.shortcutsShouldBeDisabled && App.app.appIsBeingUsed {
App.app.hideUi()
if let activeWindow = list.first {
App.app.shortcutsShouldBeDisabled =
Preferences.disableShortcutsBlacklist.contains(activeWindow.application.runningApplication.bundleIdentifier ?? "") &&
(!Preferences.disableShortcutsBlacklistOnlyFullscreen || activeWindow.isFullscreen)
if App.app.shortcutsShouldBeDisabled && App.app.appIsBeingUsed {
App.app.hideUi()
}
}
}
}