mirror of
https://github.com/google/nomulus
synced 2026-01-06 21:47:31 +00:00
Fix a bug when updating a domain without changing its registrant
When updating a filed other than the registrant for a domain, a null registratantContactId is passed to the registrant whitelist validator, causing an excpetion because null is not an element in the whitelist (if it exists). Added logic to handle null registrantContactId. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=126817310
This commit is contained in:
@@ -318,8 +318,9 @@ public class DomainFlowUtils {
|
||||
static void validateRegistrantAllowedOnTld(String tld, String registrantContactId)
|
||||
throws RegistrantNotAllowedException {
|
||||
ImmutableSet<String> whitelist = Registry.get(tld).getAllowedRegistrantContactIds();
|
||||
// Empty whitelists are ignored.
|
||||
if (!whitelist.isEmpty() && !whitelist.contains(registrantContactId)) {
|
||||
// Empty whitelists or null registrantContactId are ignored.
|
||||
if (registrantContactId != null && !whitelist.isEmpty()
|
||||
&& !whitelist.contains(registrantContactId)) {
|
||||
throw new RegistrantNotAllowedException(registrantContactId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user