diff --git a/lib/Service/ContactsIntegration.php b/lib/Service/ContactsIntegration.php index 92d13dc961..949f5008a4 100644 --- a/lib/Service/ContactsIntegration.php +++ b/lib/Service/ContactsIntegration.php @@ -236,7 +236,7 @@ private function doSearch(string $term, array $fields, bool $strictSearch, bool } $id = $r['UID']; $fn = $r['FN']; - $email = $r['EMAIL']; + $email = $r['EMAIL'] ?? null; $matches[] = [ 'id' => $id, 'label' => $fn, diff --git a/lib/Service/PhishingDetection/ContactCheck.php b/lib/Service/PhishingDetection/ContactCheck.php index 120849477c..9c7609b6e5 100644 --- a/lib/Service/PhishingDetection/ContactCheck.php +++ b/lib/Service/PhishingDetection/ContactCheck.php @@ -23,6 +23,9 @@ public function run(string $fn, string $email): PhishingDetectionResult { $emails = []; $contacts = $this->contactIntegration->getContactsWithName($fn, true); foreach ($contacts as $contact) { + if(!isset($contact['email'])) { + continue; + } foreach ($contact['email'] as $contactEmail) { $emails[] = $contactEmail; if (strcasecmp($contactEmail, $email) == 0) {