   removeOpenDocument: -> # legacy, should be reimplemented in ace bundle.
 
 
-  getActivePaneView: ->
-
-    return @tabView.getActivePane().view
+  getActivePaneView: -> return @tabView.getActivePane()?.view
 
 
   focusTab: ->


    appManager.tell 'IDE', 'setActiveTabView', @tabView
    appManager.tell 'IDE', 'setFindAndReplaceViewDelegate'
    
    @updateStatusBar()



      @updateStatusBar()
      @focusTab()

    @tabView.on 'PaneAdded', (pane) =>
      return unless pane.options.editor
      {tabHandle} = pane
