Check is user found or not.

This commit is contained in:
Faenir
2017-12-11 13:15:26 +03:00
parent 067862cee7
commit 2e3673ff07

View File

@ -42,6 +42,10 @@ class PasswordRecoveryService implements ServiceInterface
/** @var User $user */
$user = $this->query->whereEmail($this->email)->one();
if ($user === null) {
throw new \RuntimeException('User not found.');
}
$token = TokenFactory::makeRecoveryToken($user->id);
if (!$token) {