Fixed registering multiple users with empty e-mail
This commit is contained in:
parent
97ca08cf44
commit
ac62a44ba7
1 changed files with 2 additions and 0 deletions
|
@ -304,6 +304,8 @@ class UserService
|
||||||
|
|
||||||
private function assertNoUserWithThisEmail(\Szurubooru\Entities\User $owner, $emailToCheck)
|
private function assertNoUserWithThisEmail(\Szurubooru\Entities\User $owner, $emailToCheck)
|
||||||
{
|
{
|
||||||
|
if (!$emailToCheck)
|
||||||
|
return;
|
||||||
$userWithThisEmail = $this->userDao->findByEmail($emailToCheck);
|
$userWithThisEmail = $this->userDao->findByEmail($emailToCheck);
|
||||||
if ($userWithThisEmail and $userWithThisEmail->getId() !== $owner->getId())
|
if ($userWithThisEmail and $userWithThisEmail->getId() !== $owner->getId())
|
||||||
throw new \DomainException('User with this e-mail already exists.');
|
throw new \DomainException('User with this e-mail already exists.');
|
||||||
|
|
Loading…
Reference in a new issue