Check the existence of the uid field before accessing it in Module\Photo

- Address https://github.com/friendica/friendica/issues/11218#issuecomment-1039512291
This commit is contained in:
Hypolite Petovan 2022-02-15 15:59:35 -05:00
parent 361fdccdc7
commit 3b6c40e2e6

View file

@ -288,9 +288,10 @@ class Photo extends BaseModule
} }
} }
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']); $contact = Contact::getByURL($contact['url'], false, ['avatar', 'photo', 'xmpp', 'addr']);
} }
if (!empty($contact['photo']) && !empty($contact['avatar'])) { if (!empty($contact['photo']) && !empty($contact['avatar'])) {
// Fetch photo directly // Fetch photo directly
$resourceid = MPhoto::ridFromURI($contact['photo']); $resourceid = MPhoto::ridFromURI($contact['photo']);