Add empty pointer judgement.