From 2fdf39e8b88affd5fa537fef5d11d52a0bf13017 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 26 Mar 2023 18:49:42 -0400 Subject: [PATCH] Skip nonexistent contacts in Pofile/Contacts - Address part of https://github.com/friendica/friendica/issues/12486#issuecomment-1428489772 --- src/Module/Profile/Contacts.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Module/Profile/Contacts.php b/src/Module/Profile/Contacts.php index dde138d8cc..3942ac5d80 100644 --- a/src/Module/Profile/Contacts.php +++ b/src/Module/Profile/Contacts.php @@ -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':