Add null check in ToString.