Browse Source

Fix NRE in ContextMenuEntry.cs

pull/1167/head
Siegfried Pammer 7 years ago
parent
commit
4267672ab2
  1. 4
      ILSpy/ContextMenuEntry.cs

4
ILSpy/ContextMenuEntry.cs

@ -77,8 +77,8 @@ namespace ICSharpCode.ILSpy
ReferenceSegment reference;
if (textView != null)
reference = textView.GetReferenceSegmentAtMousePosition();
else if (listBox != null)
reference = new ReferenceSegment { Reference = ((SearchResult)listBox.SelectedItem).Member };
else if (listBox?.SelectedItem is SearchResult result)
reference = new ReferenceSegment { Reference = result.Member };
else
reference = null;
var position = textView != null ? textView.GetPositionFromMousePosition() : null;

Loading…
Cancel
Save