stopIfNull function

Stop if an object is NULL