diff --git a/src/command-registry.coffee b/src/command-registry.coffee index a9b953536..870093e2f 100644 --- a/src/command-registry.coffee +++ b/src/command-registry.coffee @@ -92,10 +92,10 @@ class CommandRegistry disposable.add @add(target, commandName, callback) return disposable - if typeof target is 'string' - if typeof callback isnt 'function' - throw new Error("Can't register a command with non-function callback.") + if typeof callback isnt 'function' + throw new Error("Can't register a command with non-function callback.") + if typeof target is 'string' validateSelector(target) @addSelectorBasedListener(target, commandName, callback) else