Check for null and react accordingly