Skip to content

Commit

Permalink
Merge pull request #4551 from Tyriar/npes
Browse files Browse the repository at this point in the history
Fix NPEs on buffer line and windowsPty option
  • Loading branch information
Tyriar authored Jun 9, 2023
2 parents cc1089e + ffadc0b commit 2ac2eea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/common/InputHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1152,10 +1152,12 @@ export class InputHandler extends Disposable implements IInputHandler {
* @param y row index
*/
private _resetBufferLine(y: number, respectProtect: boolean = false): void {
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;
line.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), respectProtect);
this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + y);
line.isWrapped = false;
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y);
if (line) {
line.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), respectProtect);
this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + y);
line.isWrapped = false;
}
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/common/services/OptionsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,16 @@ export class OptionsService extends Disposable implements IOptionsService {
if (value <= 0) {
throw new Error(`${key} cannot be less than or equal to 0, value: ${value}`);
}
break;
case 'rows':
case 'cols':
if (!value && value !== 0) {
throw new Error(`${key} must be numeric, value: ${value}`);
}
break;
case 'windowsPty':
value = value ?? {};
break;
}
return value;
}
Expand Down

0 comments on commit 2ac2eea

Please sign in to comment.