diff --git a/src/logic/events/KeyboardEvents.swift b/src/logic/events/KeyboardEvents.swift index 5a974945..b888d771 100644 --- a/src/logic/events/KeyboardEvents.swift +++ b/src/logic/events/KeyboardEvents.swift @@ -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