Bugfix: ImapContactsSuggestions error on empty $aUids

This commit is contained in:
the-djmaze 2022-05-28 23:38:41 +02:00
parent 4c752f9a15
commit 48a954e077

View file

@ -29,6 +29,7 @@ class ImapContactsSuggestions implements \RainLoop\Providers\Suggestions\ISugges
); );
$aResult = []; $aResult = [];
if ($aUids) {
foreach ($oImapClient->Fetch(['BODY.PEEK[HEADER.FIELDS (FROM)]'], \implode(',', $aUids), true) as $oFetchResponse) { foreach ($oImapClient->Fetch(['BODY.PEEK[HEADER.FIELDS (FROM)]'], \implode(',', $aUids), true) as $oFetchResponse) {
$oHeaders = new \MailSo\Mime\HeaderCollection($oFetchResponse->GetHeaderFieldsValue()); $oHeaders = new \MailSo\Mime\HeaderCollection($oFetchResponse->GetHeaderFieldsValue());
$oFrom = $oHeaders->GetAsEmailCollection(\MailSo\Mime\Enumerations\Header::FROM_, true); $oFrom = $oHeaders->GetAsEmailCollection(\MailSo\Mime\Enumerations\Header::FROM_, true);
@ -36,6 +37,7 @@ class ImapContactsSuggestions implements \RainLoop\Providers\Suggestions\ISugges
$aResult[] = [$oMail->GetEmail(), $oMail->GetDisplayName()]; $aResult[] = [$oMail->GetEmail(), $oMail->GetDisplayName()];
} }
} }
}
return $aResult; return $aResult;
} }