Skip to content

Commit ecddf84

Browse files
sheetalkamatmhegazy
authored andcommitted
Fix the assert for undefined leaf in LineNode (microsoft#21924)
Fixes microsoft#21818
1 parent b6f82ad commit ecddf84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server/scriptVersionCache.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ namespace ts.server {
680680

681681
// Skipped all children
682682
const { leaf } = this.lineNumberToInfo(this.lineCount(), 0);
683-
return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf.charCount(), lineText: undefined };
683+
return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf ? leaf.charCount() : 0, lineText: undefined };
684684
}
685685

686686
/**

0 commit comments

Comments
 (0)