Skip to content

VariableRequiresSetAssignmentEvaluator is missing a check for null #3181

@MDoerner

Description

@MDoerner

When pasing the projec from #3178, I got the following warning in the log.

2017-07-29 20:37:42.1658;WARN-2.0.14.24961;Rubberduck.Inspections.Rubberduck.Inspections.Inspector+<>c__DisplayClass6_2;System.NullReferenceException: Object reference not set to an instance of an object.
   at Rubberduck.Inspections.VariableRequiresSetAssignmentEvaluator.RHSUsesNew(LetStmtContext letStmtContext)
   at Rubberduck.Inspections.VariableRequiresSetAssignmentEvaluator.ObjectOrVariantRequiresSetAssignment(IdentifierReference objectOrVariantRef, IEnumerable`1 variantAndObjectDeclarations)
   at Rubberduck.Inspections.VariableRequiresSetAssignmentEvaluator.RequiresSetAssignment(IdentifierReference reference, RubberduckParserState state)
   at Rubberduck.Inspections.Concrete.ObjectVariableNotSetInspection.<GetInspectionResults>b__3_3(IdentifierReference reference)
   at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   at System.Linq.Enumerable.<>c__DisplayClass6_0`1.<CombinePredicates>b__0(TSource x)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at Rubberduck.Inspections.Rubberduck.Inspections.Inspector.<>c__DisplayClass6_2.<FindIssuesAsync>b__5();

Apparently, a check for null is missing somewhere in the VariableRequiresSetAssignmentEvaluator. Maybe something else is wrong, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIdentifies work items for known bugsdifficulty-01-ducklingIssue where no particularly involved knowledge of the internal API is needed.feature-inspectionsup-for-grabsUse this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions