Skip to content

Commit 27f3dab

Browse files
committed
Add null check in FindEvents(Declaration). Closes #4259
1 parent 10114ad commit 27f3dab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Rubberduck.Parsing/VBA/DeclarationCaching/DeclarationFinder.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,10 @@ public bool IsMatch(string declarationName, string potentialMatchName)
503503

504504
private IEnumerable<Declaration> FindEvents(Declaration module)
505505
{
506-
Debug.Assert(module != null);
506+
if (module is null)
507+
{
508+
return Enumerable.Empty<Declaration>();
509+
}
507510

508511
var members = Members(module.QualifiedName.QualifiedModuleName);
509512
return members == null

0 commit comments

Comments
 (0)