Commit 66ce2943 authored by Nicolas Guerrier's avatar Nicolas Guerrier Committed by Nikolay Lobachev
Browse files

Issue #3206103 by LOBsTerr: Skip validation if email is empty

parent c451b93e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -65,6 +65,11 @@ class PreventDuplicatedConstraintValidator extends ConstraintValidator implement
    }

    $mail = $entity->get('invitee_mail')->getString();
    // Skip validation if email is empty.
    if (empty($mail)) {
      return;
    }

    $group = $entity->get('gid')->first()->get('entity')->getTarget()->getValue();
    if ($user = user_load_by_mail($mail)) {
      // Check if user already a member.