     'language-idris:proof-search': @doProofSearch
 
   isIdrisFile: (uri) ->
-    if uri == undefined
+    if uri? && uri.match?
+      uri.match /\.idr$/
+    else
       false
-    else
-      uri.match /\.idr$/
 
   idrisFileOpened: (editor) ->
     @idrisBuffers += 1

    ).bind(this)
    return

  doCaseSplit: ->
    editor = atom.workspace.getActiveEditor()
    line = editor.getCursor(0).getBufferRow()
    word = @getWordUnderCursor()
    @model.caseSplit line + 1, word, ((err, split) ->
      if err

        console.log '... ' + progress
        @statusbar.setStatus 'Idris: ' + progress
      else
        @statusbar.setStatus 'Idris: ' + JSON.stringify(message)
      return
    ).bind(this)
    return
