   navigateToCaller: ->
     return unless @trace? and @frame?
 
-    @trace.callerOf(@frame)?.navigateTo()
+    f = @trace.callerOf(@frame)
+    if f?
+      @frame = f
+      @frame.navigateTo()
 
   navigateToCalled: ->
     return unless @trace? and @frame?
 
-    @trace.calledFrom(@frame)?.navigateTo()
+    f = @trace.calledFrom(@frame)
+    if f?
+      @frame = f
+      @frame.navigateTo()
 
 module.exports = NavigationView: NavigationView

        @span class: 'inline-block index', outlet: 'frameIndex'
        @span class: 'inline-block divider', '/'
        @span class: 'inline-block total', outlet: 'frameTotal'

  initialize: ->
    @subscribe Stacktrace, 'active-changed', (e) =>

          # Allow the already-set @frame a chance to see if it still applies.
          # This lets the caller and called navigation work properly, even if multiple frames are
          # on the same line.
          if @frame? and @frame.isOn(pos)
            @useFrame(@frame)
          else
            # Otherwise, scan the trace for a matching frame.
            frame = @trace.atEditorPosition(pos)
            if frame? then @useFrame(frame) else @unfocusFrame()
