Merge pull request #11983 from MrPetovan/bug/fatal-errors

Contact array can be empty in Model\Contact::getAvatarPath
This commit is contained in:
Philipp 2022-10-11 17:52:17 +02:00 committed by GitHub
commit 04564f0320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1681,9 +1681,7 @@ class Contact
* Return the photo path for a given contact array in the given size * Return the photo path for a given contact array in the given size
* *
* @param array $contact contact array * @param array $contact contact array
* @param string $field Fieldname of the photo in the contact array
* @param string $size Size of the avatar picture * @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 * @return string photo path
*/ */
@ -1711,7 +1709,7 @@ class Contact
} }
} }
return self::getAvatarUrlForId($contact['id'], $size, $contact['updated'] ?? ''); return self::getAvatarUrlForId($contact['id'] ?? 0, $size, $contact['updated'] ?? '');
} }
/** /**