Skip to content

Throw when xxxOptions are null #1076

Open
@nulltoken

Description

@nulltoken

From https://github.com/libgit2/libgit2sharp/pull/1068/files#r31650592

We rely on the following pattern throughout the codebase.

public Things DoThings()
{
     return DoThings(null);
}

public Things DoThings(ThingsOptions options)
{
     options = options ?? new ThingsOptions();
     [...]
}

Let's change this to the following one

public Things DoThings()
{
     return DoThings(new ThingsOptions());
}

public Things DoThings(ThingsOptions options)
{
     Ensure.ArgumentNotNull(options);
     [...]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions