]> git.mxchange.org Git - friendica.git/commitdiff
Skip nonexistent contacts in Pofile/Contacts
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Mar 2023 22:49:42 +0000 (18:49 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 28 Mar 2023 01:31:54 +0000 (21:31 -0400)
- Address part of https://github.com/friendica/friendica/issues/12486#issuecomment-1428489772

src/Module/Profile/Contacts.php

index dde138d8cc93c9a60a956d4c2628da4363533f74..3942ac5d8014fefcf1c4f68c793219ab9e1dabea 100644 (file)
@@ -121,11 +121,14 @@ class Contacts extends Module\BaseProfile
                                        ['uri-id' => $contact['uri-id'], 'uid' => [0, $this->userSession->getLocalUserId()]],
                                        ['order' => ['uid' => 'DESC']]
                                );
-                               return Module\Contact::getContactTemplateVars($contact);
+                               return $contact ? Module\Contact::getContactTemplateVars($contact) : null;
                        },
                        Model\Contact::selectToArray(['uri-id'], $condition, $params)
                );
 
+               // Remove nonexistent contacts
+               $contacts = array_filter($contacts);
+
                $desc = '';
                switch ($type) {
                        case 'followers':