ShootingStar
A better way to handle this situation is to use the safe call operator (?.). Safe call short-circuits