Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-469227: False "Possible NRE"

$
0
0
Reporter Ivan Serduk (IvanSerduk) Ivan Serduk (IvanSerduk)
Created Apr 11, 2018 7:04:49 PM
Updated Apr 11, 2018 7:04:49 PM
Subsystem Code Analysis - C#
Assignee Ivan Serduk (IvanSerduk)
Priority Normal
State Submitted
Type Bug
Fix version 2018.2
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System;
using JetBrains.Annotations;

public class Class2
{
    [CanBeNull] private MyForm myForm;

    public void Test()
    {
        if (myForm == null)
            return;
        myForm.Activated += obj => Activated();
        var s = myForm.ToString(); // false possible NRE
    }

    private void Activated() { }
}

public class MyForm
{
    public event Action<object> Activated;
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>