     }
     
     func doubleClickedLine(sender: AnyObject?) {
+        guard tableView.clickedRow < filteredLines.count else { return }
+        
         let line = filteredLines[tableView.clickedRow]
         jumpToTimeCallback(time: line.timecode)
     }

    
    @IBAction func search(sender: NSSearchField) {
        // disables scrolling during search
        enableScrolling = (sender.stringValue == "")
        
        tableView.reloadData()
    }

    }
    
    func tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) -> NSView? {
        guard row < filteredLines.count else { return nil }
        
        let cell = tableView.makeViewWithIdentifier(Storyboard.cellIdentifier, owner: tableView) as! TranscriptLineTableCellView
        
        cell.foregroundColor = textColor
