Skip to content

Commit

Permalink
fix: crash on blacklisted app with main shortcut cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Oct 6, 2020
1 parent 5d9bc8e commit c3f0686
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/logic/events/KeyboardEvents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3f0686

Please sign in to comment.