Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"else" not needed after "throw new ArgumentNullException" #35

Closed
letiemble opened this issue Feb 22, 2011 · 2 comments
Closed

"else" not needed after "throw new ArgumentNullException" #35

letiemble opened this issue Feb 22, 2011 · 2 comments

Comments

@letiemble
Copy link

Hi,

I have noticed in a few places that an "else" is shown after argument checks (for nullity or anything else).

For example, in System.Collections.ArrayList :

public static ArrayList Adapter(IList list)
{
    if (list == null)
    {
        throw new ArgumentNullException("list");
    }
    else
    {
        return new ArrayList.IListWrapper(list);
    }
}

The else is not necessary.

@dsrbecky
Copy link
Member

Should be fixed in e229194

@letiemble
Copy link
Author

Great !!! Works like a charm even with multiple argument checks. Thanks.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants