Skip to content

FilterAliasAttribute throws ArgumentNullException with the value of alias param as the paramName rather than the nameof the alias param #145

@brental

Description

@brental

The FilterAliasAttribute constructor whether the alias parameter IsNullOrEmpty and if it is, throws an ArgumentNullException. However, it is throwing the ArgumentNullException with the value of the alias parameter (which would always be null or empty) rather than the nameof the alias parameter as the ArgumentNullException expects. So, it seems like the constructor should be this:

public FilterAliasAttribute(string alias)
{
    if (string.IsNullOrEmpty(alias))
    {
        throw new ArgumentNullException(nameof(alias));
    }

    Alias = alias;
}

Rather than this:

public FilterAliasAttribute(string alias)
{
    if (string.IsNullOrEmpty(alias))
    {
        throw new ArgumentNullException(alias);
    }

    Alias = alias;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions