Avoid NullReferenceExceptions