Skip to content

Commit da15ef2

Browse files
authored
Fix a crash in an anonymous buffer that copilot is writing to. (#60377)
1 parent 2161893 commit da15ef2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/server/scriptVersionCache.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ export class LineNode implements LineCollection {
632632

633633
walk(rangeStart: number, rangeLength: number, walkFns: LineIndexWalker): void {
634634
// assume (rangeStart < this.totalChars) && (rangeLength <= this.totalChars)
635+
if (this.children.length === 0) return;
635636
let childIndex = 0;
636637
let childCharCount = this.children[childIndex].charCount();
637638
// find sub-tree containing start

0 commit comments

Comments
 (0)