From c4f431849bc0665f32efa005c5f2ef938c920a48 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 16 Feb 2017 22:41:08 -0800 Subject: [PATCH] Add a null check on linkifyRow --- src/Linkifier.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Linkifier.ts b/src/Linkifier.ts index a2a5a5da..b5b3247c 100644 --- a/src/Linkifier.ts +++ b/src/Linkifier.ts @@ -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);