From 18f37440dc411a4a61453a0c976edc2d46be7dcd Mon Sep 17 00:00:00 2001 From: Bruno Ribeito Date: Sun, 15 Jul 2018 19:36:49 +0100 Subject: [PATCH] Prevent Uncaught TypeError - Cannot read property 'isWrapped' on Linkifier --- src/Linkifier.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Linkifier.ts b/src/Linkifier.ts index 88ff1b78..dc04472d 100644 --- a/src/Linkifier.ts +++ b/src/Linkifier.ts @@ -169,10 +169,18 @@ export class Linkifier extends EventEmitter implements ILinkifier { return; } // If the first row is wrapped, backtrack to find the origin row and linkify that + let line = (this._terminal.buffer.lines.get(absoluteRowIndex)); + do { rowIndex--; absoluteRowIndex--; - } while ((this._terminal.buffer.lines.get(absoluteRowIndex)).isWrapped); + line = (this._terminal.buffer.lines.get(absoluteRowIndex)); + + if (!line) { + return; + } + + } while (line.isWrapped); } // Construct full unwrapped line text