Have Visual Studio compiler check for NullReferenceExceptions I’ve just corrected the following piece of source code, written by a former colleague: