Skip to content

Commit b2fc82f

Browse files
committed
client/shortcuts: make sure bindings exist first
1 parent 583eb34 commit b2fc82f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

client/app/lib/shortcutscontroller.coffee

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ class ShortcutsController extends events.EventEmitter
188188
@shortcuts.update collection.name, model.name, {
189189
binding: klass._replacePlatformBinding model, binding
190190
options: { enabled: enabled }
191-
},
192-
klass._isCustomShortcut raw
191+
}, klass._isCustomShortcut raw
193192

194193
@emit 'change', collection, model
195194

@@ -250,8 +249,7 @@ class ShortcutsController extends events.EventEmitter
250249
@shortcuts.update collection.name, model.name, {
251250
binding: klass._replacePlatformBinding model, override.binding
252251
options: { enabled: override.enabled }
253-
},
254-
klass._isCustomShortcut model
252+
}, klass._isCustomShortcut model
255253

256254
return
257255

@@ -483,9 +481,11 @@ class ShortcutsController extends events.EventEmitter
483481
#
484482
@_replacePlatformBinding: (model, platformBinding) ->
485483

484+
return null if not model or not platformBinding
485+
486486
binding = _.clone model.binding, yes
487487
idx = klass._bindingPlatformIndex()
488-
arr = platformBinding?.filter _.isString
488+
arr = platformBinding?.filter? _.isString
489489
binding[idx] = if (_.isArray arr) and arr.length then arr else null
490490

491491
return binding

0 commit comments

Comments
 (0)