From f16b1df83f28a68595df6174468d34dd53ae270e Mon Sep 17 00:00:00 2001 From: RealKinetix Date: Wed, 14 Jul 2021 13:46:38 -0700 Subject: [PATCH] Adjust where the code is to avoid empty warning Shifted the code to avoid: PHP Warning: Undefined array key "totalItems" in /home/friendicadev/friendica/src/Model/APContact.php on line 277 --- src/Model/APContact.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Model/APContact.php b/src/Model/APContact.php index eb34e502ec..64f45a8451 100644 --- a/src/Model/APContact.php +++ b/src/Model/APContact.php @@ -272,12 +272,12 @@ class APContact if (!empty($apcontact['followers'])) { $followers = ActivityPub::fetchContent($apcontact['followers']); - // Mastodon seriously allows for this condition? - // Jul 14 2021 - See https://mastodon.online/@goes11 for a negative followers count - if ($followers['totalItems'] < 0) { - $followers['totalItems'] = 0; - } if (!empty($followers['totalItems'])) { + // Mastodon seriously allows for this condition? + // Jul 14 2021 - See https://mastodon.online/@goes11 for a negative followers count + if ($followers['totalItems'] < 0) { + $followers['totalItems'] = 0; + } $apcontact['followers_count'] = $followers['totalItems']; } }