Reporter | Maria Pleskunina (Maria.Pleskunina) |
---|---|
Created | Apr 20, 2018 5:01:01 PM |
Updated | Apr 20, 2018 5:01:15 PM |
Subsystem | Code Analysis - C# |
Assignee | Ivan Serduk (IvanSerduk) |
Priority | Major |
State | Submitted |
Type | Bug |
Fix version | No Fix versions |
Affected versions | 2017.3.5, 2018.1 |
Fixed In Version ReSharper | Undefined |
VsVersion | All Versions |
In Method1() you can see that there is a condition that checks MyEvent for null, then goes a call to Method3() that does nothing, and then we envoke the event, MyEvent has a warning of a possible NullReferenceException on it, this is wrong since the condition was checked previously. If we remove the call to Method3() the warning will go away as it is shown in Method2().