Add null check to uniqueness validator.