About System.ArgumentNullException abnormal

What is ArgumentNullException

When a null reference (Visual Basic for Nothing) is transmitted to the initiator does not accept it as abnormal effective method parameters.

inherit
Object
Exception
SystemException
ArgumentException
ArgumentNullException

Detailed description

When you call a method, if at least one argument is passed null null, an exception is thrown. ArgumentNullException

In two major cases, an exception is thrown at run time, both cases are reflected developer error: ArgumentNullException

  • The non-instantiated objects passed to the method. To prevent this error, instantiate the object.

  • Then, from the method call returns the object passed as a parameter to the second method, but the original value of the returned object null. To prevent this error, please check the return value nullis, if the return value is not nullthat the second method is called.

ArgumentNullException behaves ArgumentException act the same. This method is provided in order that the application code can be distinguished by nullabnormal and non-null parameter caused by abnormality of a parameter. 

HRESULT

ArgumentNullException using E_POINTER value of HRESULT 0x80004003.

Guess you like

Origin www.cnblogs.com/yilang/p/11976646.html