Skip to content

Commit

Permalink
Check the existence of the uid field before accessing it in Module\…
Browse files Browse the repository at this point in the history
…Photo

- Address friendica#11218 (comment)
  • Loading branch information
MrPetovan committed Feb 15, 2022
1 parent 361fdcc commit 3b6c40e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Module/Photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,10 @@ private static function getPhotoByid(int $id, $type, $customsize)
}
}

If (($contact['uid'] != 0) && empty($contact['photo']) && empty($contact['avatar'])) {
if (!empty($contact['uid']) && empty($contact['photo']) && empty($contact['avatar'])) {
$contact = Contact::getByURL($contact['url'], false, ['avatar', 'photo', 'xmpp', 'addr']);
}

if (!empty($contact['photo']) && !empty($contact['avatar'])) {
// Fetch photo directly
$resourceid = MPhoto::ridFromURI($contact['photo']);
Expand Down

0 comments on commit 3b6c40e

Please sign in to comment.