X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FContact.php;h=855f90431c3fd3a88919ba48986d1e3c5b7906b9;hb=7441bd90c83ba9822d41ab0972c5530d22195557;hp=6dbba6ed408fa4fed5163bcb39c8394f64e8bd12;hpb=4fbec33af0a31b1cc046fadf3c0b4cd9a6b0026d;p=friendica.git diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 6dbba6ed40..855f90431c 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -207,7 +207,12 @@ class Contact if (empty($cid)) { return []; } - return self::getById($cid, $fields); + + $contact = self::getById($cid, $fields); + if (empty($contact)) { + return []; + } + return $contact; } // Add internal fields @@ -238,6 +243,10 @@ class Contact $contact = DBA::selectFirst('contact', $fields, $condition, $options); } + if (!DBA::isResult($contact)) { + return []; + } + // Update the contact in the background if needed if ((($contact['updated'] < DateTimeFormat::utc('now -7 days')) || empty($contact['avatar'])) && in_array($contact['network'], Protocol::FEDERATED)) {