Skip to content

Commit 768467f

Browse files
committed
fixed NRE in FindProjectScopeDeclaration when built-in declarations are involved.
1 parent 296a7e9 commit 768467f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Rubberduck.Parsing/Symbols/IdentifierReferenceResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ private Declaration FindProjectScopeDeclaration(string identifierName, Declarati
10931093
// the "$" in e.g. "UCase$" isn't picked up as part of the identifierName, so we need to add it manually:
10941094
var matches = _declarationFinder.MatchName(identifierName).Where(item =>
10951095
(!item.IsBuiltIn || item.IdentifierName == identifierName + (hasStringQualifier ? "$" : string.Empty))
1096-
&& ((item.ParentDeclaration.DeclarationType == DeclarationType.Module
1096+
&& item.ParentDeclaration != null && ((item.ParentDeclaration.DeclarationType == DeclarationType.Module
10971097
|| item.ParentDeclaration.HasPredeclaredId))
10981098
|| item.ParentScopeDeclaration.Equals(localScope)).ToList();
10991099

0 commit comments

Comments
 (0)