Catching NullReferenceExceptions to help debug an issue