Protection for potentially null ptr problems