Which exception should be thrown here?
public static string DoStuff(this Control control)
{
if (control == null)
{
throw new ArgumentNullException();
}
// Code goes here...
}
I thought about the following:
- ArgumentNullException (as used below)
- InvalidOperationException
- NullReferenceException
My choice would be ArgumentNullException. Is this correct?