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

      null

  addBuffer: (path) ->
    return if not path

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

    buffer = @buffers[path]

      mode = @modeForPath path
      buffer.setMode new mode if mode

      return
      @buffers[path] = buffer

    buffer.on 'change', -> buffer.$atom_dirty = true
