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; }