A NullReferenceException (NRE) occurs when code tries to access members of a variable which has no value assigned.
NullReferenceException
Declaring a reference variable does not automatically assign it a value.