Skip to content

Commit 30625ad

Browse files
authored
Verify the range is valid before getting the lin max column (microsoft#250450)
verify the range is valid before getting the lin max column
1 parent d9145a2 commit 30625ad

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ export class MarkerHoverParticipant implements IEditorHoverParticipant<MarkerHov
7171
}
7272

7373
const model = this._editor.getModel();
74-
const lineNumber = anchor.range.startLineNumber;
74+
const anchorRange = anchor.range;
75+
if (!model.isValidRange(anchor.range)) {
76+
return [];
77+
}
78+
const lineNumber = anchorRange.startLineNumber;
7579
const maxColumn = model.getLineMaxColumn(lineNumber);
7680
const result: MarkerHover[] = [];
7781
for (const d of lineDecorations) {

0 commit comments

Comments
 (0)