Skip to content

Commit

Permalink
Fix NPE in webgl renderer
Browse files Browse the repository at this point in the history
Theory is this can happen when a resize down happens as end will be too big

See microsoft/vscode#166878
  • Loading branch information
Tyriar committed Dec 16, 2022
1 parent 880b726 commit ea7571c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addons/xterm-addon-webgl/src/WebglRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
let lastBg: number;
let y: number;
let row: number;
let line: IBufferLine;
let line: IBufferLine | undefined;
let joinedRanges: [number, number][];
let isJoined: boolean;
let lastCharX: number;
Expand All @@ -364,7 +364,10 @@ export class WebglRenderer extends Disposable implements IRenderer {

for (y = start; y <= end; y++) {
row = y + terminal.buffer.ydisp;
line = terminal.buffer.lines.get(row)!;
line = terminal.buffer.lines.get(row);
if (!line) {
break;
}
this._model.lineLengths[y] = 0;
joinedRanges = this._characterJoinerService.getJoinedCharacters(row);
for (x = 0; x < terminal.cols; x++) {
Expand Down

0 comments on commit ea7571c

Please sign in to comment.