deepsourcestatus / test-repository

Consider collapsing the null check CS-R1040
Anti-pattern
Major
8 months ago8 months old
Null check can be simplified
 74        Foo? f = null;
 75        // CS-R1040: Null check can be collapsed and written as `f?.Bar == null`.
 76        // https://deepsource.io/directory/analyzers/csharp/issues/CS-R1040.
 77        if (f == null || f.Bar == null) 78        {
 79            //
 80        }