Add null check when fetching line string

See Microsoft/vscode#34466
This commit is contained in:
Daniel Imms
2017-09-28 14:52:56 -04:00
parent 313d1e6fec
commit 13d46476c8
+3
View File
@@ -211,6 +211,9 @@ export class Buffer implements IBuffer {
let widthAdjustedStartCol = startCol;
let widthAdjustedEndCol = endCol;
const line = this.lines.get(lineIndex);
if (!line) {
return '';
}
for (let i = 0; i < line.length; i++) {
const char = line[i];
lineString += char[CHAR_DATA_CHAR_INDEX];