Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit ef49522

Browse files
committed
Fix 'InvalidOperationException: Sequence contains no elements' in CaretReferenceHighlightRenderer.Draw
1 parent 032f01c commit ef49522

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/AddIns/BackendBindings/CSharpBinding/Project/Src/CaretReferenceHighlightRenderer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public void Dispose()
7979
public void Draw(TextView textView, DrawingContext drawingContext)
8080
{
8181
if (currentReferences == null) {
82+
if (textView.VisualLines.Count == 0)
83+
return;
8284
var start = textView.VisualLines.First().FirstDocumentLine.LineNumber;
8385
var end = textView.VisualLines.Last().LastDocumentLine.LineNumber;
8486
currentReferences = new List<ISegment>();

0 commit comments

Comments
 (0)