Skip to content

Commit

Permalink
Fix possible NRE in Quick Info
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutch committed Apr 30, 2024
1 parent cae105a commit 1e71b80
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ QuickInfoItem GetQuickInfoItemInternal (IAsyncQuickInfoSession session, Cancella
elements.Add (displayElementFactory.GetDiagnosticTooltip (diagnostic));

var tagSpan = mappingSpan.Span.GetSpans (snapshot).First ();
applicableToSpan = applicableToSpan.HasValue ? applicableToSpan.Value.Overlap (tagSpan) : tagSpan;
applicableToSpan = applicableToSpan.HasValue ? (applicableToSpan.Value.Overlap (tagSpan)?? triggerSpan) : tagSpan;
}

applicableToSpan ??= triggerSpan;

return new QuickInfoItem (
snapshot.CreateTrackingSpan (applicableToSpan.Value, SpanTrackingMode.EdgeExclusive),
new ContainerElement (ContainerElementStyle.Stacked | ContainerElementStyle.VerticalPadding, elements)
Expand Down

0 comments on commit 1e71b80

Please sign in to comment.