     @renderResult(result)
 
   renderResult: (result) ->
+    matches = result?.matches
     selectedIndex = @matches.find('.selected').index()
 
     @matches.empty()

    else
      @description.hide()

    matches = result?.matches
    if not matches or matches.length == 0
      @hide()
    else


module.exports =
class ResultView extends View
  @content: (model, filePath, result) ->
    iconClass = if fs.isReadmePath(filePath) then 'icon-book' else 'icon-file-text'

    @li class: 'path list-nested-item', 'data-path': _.escapeAttribute(filePath), =>
