diff --git a/src/User/Factory/MailFactory.php b/src/User/Factory/MailFactory.php index 42fc6b68..be0c99b8 100644 --- a/src/User/Factory/MailFactory.php +++ b/src/User/Factory/MailFactory.php @@ -60,7 +60,7 @@ public static function makeRecoveryMailerService($email, Token $token = null) $from = $module->mailParams['fromEmail']; $subject = $module->mailParams['recoveryMailSubject']; $params = [ - 'user' => $token->user, + 'user' => $token ? $token->user : null, 'token' => $token, ]; @@ -82,7 +82,7 @@ public static function makeConfirmationMailerService(User $user, Token $token = $from = $module->mailParams['fromEmail']; $subject = $module->mailParams['confirmationMailSubject']; $params = [ - 'user' => $token->user, + 'user' => $token ? $token->user : null, 'token' => $token, ];