In addition to Richard's comment, you might also be confusing how variable assignment actually works in C#. Think of calling a constructor like calling a method which produces a value. What actually happens is the constructor is called (the variable currently remains unchanged) and, when successful, C# takes the object that was just constructed (or "returned from the constructor") and assigns it to the variable.
Now, if an exception is thrown, that last part which assigns it to the variable doesn't happen, so the variable would contain the default value which is
null
Another way to think of it is:
StringReader reader = null;
try
{
reader = new StringReader(null);
}
finally
{
reader?.Dispose();
}
In the above example, what would the value of
reader
be in the
finally
block? Well, the constructor threw an exception which means that C# jumps immediately to the
finally
block before the variable assignment can happen. This means the value of
reader
is guaranteed to be
null
when the
finally
block triggers.