         @ace.setSession  new EditSession ''
 
   focusBuffer: (path) ->
-    return if @activePath == path
+    return if not path or @activePath == path
 
     @activePath = path
 

    Event.on 'window:open', (e) => @addBuffer e.details
    Event.on 'window:close', (e) => @removeBuffer e.details

    @addBuffer path

    # Resize editor when panes are added/removed
    el = document.body

      null

  addBuffer: (path) ->
    throw "#{@constructor.name}: Cannot create buffer from a directory `#{path}`" if fs.isDirectory path

    buffer = @buffers[path]
