From: nupplaPhil Date: Sat, 1 Feb 2020 21:42:36 +0000 (+0100) Subject: Fix Lookup X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=206b53477ec4d0538be5ce92619f8ec920019848;p=friendica.git Fix Lookup --- diff --git a/src/Util/EMailer/MailBuilder.php b/src/Util/EMailer/MailBuilder.php index fe801bd562..c2c2f75dc5 100644 --- a/src/Util/EMailer/MailBuilder.php +++ b/src/Util/EMailer/MailBuilder.php @@ -140,14 +140,17 @@ abstract class MailBuilder { if ((empty($this->recipientAddress)) && !empty($this->recipientUid)) { - $user = User::getById($this->recipientUid, ['username', 'email']); + $user = User::getById($this->recipientUid, ['email']); if (!empty($user)) { - $this->senderName = $user['username']; - $this->senderAddress = $user['email']; + $this->recipientAddress = $user['email']; } } + if (empty($this->recipientAddress)) { + throw new InternalServerErrorException('Recipient address is missing.'); + } + if (empty($this->senderAddress) || empty($this->senderName)) { throw new InternalServerErrorException('Sender address or name is missing.'); }