From de8d9a720a6cee65bce83bcb2928fc02829a92ed Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 25 May 2019 21:17:36 -0700 Subject: [PATCH] Fix NPE in reflow See microsoft/vscode#72149 --- src/Buffer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Buffer.ts b/src/Buffer.ts index 37d61d88..686e0a38 100644 --- a/src/Buffer.ts +++ b/src/Buffer.ts @@ -294,7 +294,7 @@ export class Buffer implements IBuffer { for (let y = this.lines.length - 1; y >= 0; y--) { // Check whether this line is a problem let nextLine = this.lines.get(y) as BufferLine; - if (!nextLine.isWrapped && nextLine.getTrimmedLength() <= newCols) { + if (!nextLine || !nextLine.isWrapped && nextLine.getTrimmedLength() <= newCols) { continue; }