]> git.mxchange.org Git - friendica.git/commitdiff
[hotfix] Prevent fatal error in profile with pinned posts
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 7 Nov 2019 20:51:05 +0000 (15:51 -0500)
committerGitHub <noreply@github.com>
Thu, 7 Nov 2019 20:51:05 +0000 (15:51 -0500)
- `$a->profile['profile_uid']` may not be set
- Addresses https://github.com/friendica/friendica/issues/7675#issuecomment-551255174

src/Module/Profile.php

index cd0ee66bb95ef871c9a4d624806a84f7ca21ebb4..60dc6aa1b447074910eb3438b61da7dd8bf6974d 100644 (file)
@@ -349,7 +349,7 @@ class Profile extends BaseModule
 
                $items = DBA::toArray($items_stmt);
 
-               if ($pager->getStart() == 0) {
+               if ($pager->getStart() == 0 && !empty($a->profile['profile_uid'])) {
                        $pinned_items = Item::selectPinned($a->profile['profile_uid'], ['uri']);
                        $pinned = Item::inArray($pinned_items);
                        $items = array_merge($items, $pinned);