mirror of
https://github.com/google/nomulus
synced 2026-09-12 02:56:26 +00:00
Handle null GAE user IDs gracefully (for non-admins) (#531)
Unfortunately in our testing environments, we're all admins so it's easy to miss things like this.
This commit is contained in:
@@ -43,6 +43,7 @@ import google.registry.request.auth.AuthenticatedRegistrarAccessor;
|
||||
import google.registry.request.auth.AuthenticatedRegistrarAccessor.RegistrarAccessDeniedException;
|
||||
import google.registry.schema.domain.RegistryLock;
|
||||
import google.registry.security.JsonResponseHelper;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
@@ -119,7 +120,8 @@ public final class RegistryLockGetAction implements JsonGetAction {
|
||||
static Optional<RegistrarContact> getContactMatchingLogin(User user, Registrar registrar) {
|
||||
ImmutableList<RegistrarContact> matchingContacts =
|
||||
registrar.getContacts().stream()
|
||||
.filter(contact -> contact.getGaeUserId().equals(user.getUserId()))
|
||||
.filter(contact -> contact.getGaeUserId() != null)
|
||||
.filter(contact -> Objects.equals(contact.getGaeUserId(), user.getUserId()))
|
||||
.collect(toImmutableList());
|
||||
if (matchingContacts.size() > 1) {
|
||||
ImmutableList<String> matchingEmails =
|
||||
|
||||
Reference in New Issue
Block a user