From 3b6c40e2e6ad59f09daef08cf09366c844edd23a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 15 Feb 2022 15:59:35 -0500 Subject: [PATCH] Check the existence of the `uid` field before accessing it in Module\Photo - Address https://github.com/friendica/friendica/issues/11218#issuecomment-1039512291 --- src/Module/Photo.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Module/Photo.php b/src/Module/Photo.php index c67520b554..3d3110fd8b 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -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']); } + if (!empty($contact['photo']) && !empty($contact['avatar'])) { // Fetch photo directly $resourceid = MPhoto::ridFromURI($contact['photo']);