Add null checks before using annotation model.