]> git.mxchange.org Git - friendica.git/commitdiff
Remove next link when there aren't any introductions in Module\Api\Mastodon\FollowReq...
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 2 Feb 2020 02:38:25 +0000 (21:38 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 2 Feb 2020 02:38:25 +0000 (21:38 -0500)
src/Module/Api/Mastodon/FollowRequests.php

index 3b2de61bcc3345189cdcad456a2ac39ca300a749..169250f11caa3efea7c9838e8db5cb3d3877132e 100644 (file)
@@ -106,7 +106,10 @@ class FollowRequests extends BaseApi
                if ($introductions->getTotalCount() > $limit) {
                        $links[] = '<' . $baseUrl->get() . '/api/v1/follow_requests?' . http_build_query($base_query + ['max_id' => $introductions[count($introductions) - 1]->id]) . '>; rel="next"';
                }
-               $links[] = '<' . $baseUrl->get() . '/api/v1/follow_requests?' . http_build_query($base_query + ['since_id' => $introductions[0]->id]) . '>; rel="prev"';
+
+               if (count($introductions)) {
+                       $links[] = '<' . $baseUrl->get() . '/api/v1/follow_requests?' . http_build_query($base_query + ['since_id' => $introductions[0]->id]) . '>; rel="prev"';
+               }
 
                header('Link: ' . implode(', ', $links));