From 9e74a1bd0670e05322118e881a5915f778d7835c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 11 Oct 2022 08:26:00 -0400 Subject: [PATCH] Contact array can be empty in Model\Contact::getAvatarPath - Address https://github.com/friendica/friendica/issues/11630#issuecomment-1274195844 --- src/Model/Contact.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 2b6cb05bb..ceaf635df 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1680,11 +1680,9 @@ class Contact /** * Return the photo path for a given contact array in the given size * - * @param array $contact contact array - * @param string $field Fieldname of the photo in the contact array + * @param array $contact contact array * @param string $size Size of the avatar picture - * @param string $avatar Avatar path that is displayed when no photo had been found - * @param bool $no_update Don't perfom an update if no cached avatar was found + * @param bool $no_update Don't perfom an update if no cached avatar was found * @return string photo path */ private static function getAvatarPath(array $contact, string $size, bool $no_update = false): string @@ -1711,7 +1709,7 @@ class Contact } } - return self::getAvatarUrlForId($contact['id'], $size, $contact['updated'] ?? ''); + return self::getAvatarUrlForId($contact['id'] ?? 0, $size, $contact['updated'] ?? ''); } /**