Remove non-null assertion

This commit is contained in:
kena0ki
2021-04-01 12:05:05 -07:00
committed by Daniel Imms
parent d4a93fe7e4
commit 49cb6f74bc
+3 -1
View File
@@ -304,7 +304,9 @@ export class Terminal extends CoreTerminal implements ITerminal {
const viewportRelativeCursorY = cursorY - this.buffer.ydisp;
const cursorX = Math.min(this.buffer.x, this.cols - 1);
const cellHeight = this._renderService.dimensions.actualCellHeight;
const width = this.buffer.lines.get(cursorY)!.getWidth(cursorX);
const bufferLine = this.buffer.lines.get(cursorY);
if (!bufferLine) return;
const width = bufferLine.getWidth(cursorX);
const cellWidth = this._renderService.dimensions.actualCellWidth * width;
const cursorTop = viewportRelativeCursorY * this._renderService.dimensions.actualCellHeight;
const cursorLeft = cursorX * this._renderService.dimensions.actualCellWidth;