Prevent potential NullReferenceException