Skip to content

Commit 881be8f

Browse files
Null tolerance
1 parent 5b6cdb1 commit 881be8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/AbstractReferenceFinder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,12 @@ protected static SymbolUsageInfo GetSymbolUsageInfo(
608608
while (syntaxFacts.IsQualifiedName(topNameNode.Parent))
609609
topNameNode = topNameNode.Parent;
610610

611-
var parent = topNameNode.GetRequiredParent();
611+
var parent = topNameNode?.Parent;
612612

613613
// typeof/sizeof are a special case where we don't want to return a TypeOrNamespaceUsageInfo, but rather a ValueUsageInfo.Name.
614614
// This brings it in line with nameof(...), making all those operators appear in a similar fashion.
615-
if (parent.RawKind == syntaxFacts.SyntaxKinds.TypeOfExpression ||
616-
parent.RawKind == syntaxFacts.SyntaxKinds.SizeOfExpression)
615+
if (parent?.RawKind == syntaxFacts.SyntaxKinds.TypeOfExpression ||
616+
parent?.RawKind == syntaxFacts.SyntaxKinds.SizeOfExpression)
617617
{
618618
return new(ValueUsageInfo.Name, typeOrNamespaceUsageInfoOpt: null);
619619
}

0 commit comments

Comments
 (0)