C# – Null-Conditional Operators (?. and ?[])
The System.NullReferenceException: Object reference not set to an instance of an object. exception is a common exception in C#. This exception is thrown when a variable of reference type is null and it is attempted to be accessed. This error can be avoided by using if conditions to make sure the variable is not null …