mirror of
https://github.com/google/nomulus
synced 2026-09-18 22:14:23 +00:00
Validate provided email addresses when creating a Registrar
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=240574585
This commit is contained in:
@@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
||||
import static com.google.common.collect.Sets.difference;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.model.registrar.Registrar.checkValidEmail;
|
||||
import static google.registry.util.CollectionUtils.nullToEmptyImmutableSortedCopy;
|
||||
import static java.util.stream.Collectors.joining;
|
||||
|
||||
@@ -296,7 +297,7 @@ public class RegistrarContact extends ImmutableObject implements Jsonifiable {
|
||||
@Override
|
||||
public RegistrarContact build() {
|
||||
checkNotNull(getInstance().parent, "Registrar parent cannot be null");
|
||||
checkNotNull(getInstance().emailAddress, "Email address cannot be null");
|
||||
checkValidEmail(getInstance().emailAddress);
|
||||
return cloneEmptyToNull(super.build());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user