fix: crash on blacklisted app with main shortcut cleared

This commit is contained in:
Louis Pontoise authored and lwouis committed 2020-10-07 02:10:30 +09:00
1 parent 5d9bc8e6b7
commit c3f0686fd1
1 file changed
+3 -2
+3 -2
View File
@@ -55,8 +55,9 @@ class KeyboardEvents {
if shouldDisable != App.app.globalShortcutsAreDisabled {
let fn = shouldDisable ? unregisterHotKeyIfNeeded : registerHotKeyIfNeeded
for shortcutId in globalShortcutsIds.keys {
let shortcut = ControlsTab.shortcuts[shortcutId]!.shortcut
fn(shortcutId, shortcut)
if let shortcut = ControlsTab.shortcuts[shortcutId]?.shortcut {
fn(shortcutId, shortcut)
}
}
debugPrint("toggleGlobalShortcuts", shouldDisable)
App.app.globalShortcutsAreDisabled = shouldDisable