Fix the assert for undefined leaf in LineNode (#21924)

Fixes #21818
This commit is contained in:
Sheetal Nandi 2018-02-16 16:37:32 -08:00 committed by Mohamed Hegazy
parent b6f82adfed
commit ecddf8468f

View File

@ -680,7 +680,7 @@ namespace ts.server {
// Skipped all children
const { leaf } = this.lineNumberToInfo(this.lineCount(), 0);
return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf.charCount(), lineText: undefined };
return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf ? leaf.charCount() : 0, lineText: undefined };
}
/**