Skip to content

Check that this argument is not null #218

Open
@JohanLarsson

Description

@JohanLarsson
class Program
{
    public void CallMe()
    {
        Console.WriteLine(this?.ToString() ?? "NULL");
    }

    static unsafe void Main()
    {
        var a = (Action<Program>)typeof(Program).GetMethod(nameof(CallMe)).CreateDelegate(typeof(Action<Program>));
        a(null);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzerCreate an analyzer for this.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions