mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02: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:
parent
32e8e8fdb0
commit
1ed77d5572
2 changed files with 21 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue