Add a null check on linkifyRow

This commit is contained in:
Daniel Imms
2017-02-16 22:41:08 -08:00
parent c3f31b5f65
commit c4f431849b
+5 -1
View File
@@ -117,7 +117,11 @@ export class Linkifier {
* @param {number} rowIndex The index of the row to linkify.
*/
private _linkifyRow(rowIndex: number): void {
const text = this._rows[rowIndex].textContent;
const row = this._rows[rowIndex];
if (!row) {
return;
}
const text = row.textContent;
for (let i = this._linkMatchers.length - 1; i >= 0; i--) {
const matcher = this._linkMatchers[i];
const uri = this._findLinkMatch(text, matcher.regex, matcher.matchIndex);