forked from mirror/pixelfed
Update PublicApiController, fix edge case in timeline pagination
This commit is contained in:
parent
aa4b011e25
commit
9a7289198a
1 changed files with 3 additions and 3 deletions
|
@ -378,7 +378,7 @@ class PublicApiController extends Controller
|
|||
return $status;
|
||||
})
|
||||
->filter(function($s) use($filtered) {
|
||||
return $s && in_array($s['account']['id'], $filtered) == false;
|
||||
return $s && isset($s['account']) && in_array($s['account']['id'], $filtered) == false;
|
||||
})
|
||||
->values();
|
||||
|
||||
|
@ -402,7 +402,7 @@ class PublicApiController extends Controller
|
|||
$res = collect($feed)
|
||||
->map(function($k) use($user) {
|
||||
$status = StatusService::get($k);
|
||||
if($user) {
|
||||
if($status && isset($status['account']) && $user) {
|
||||
$status['favourited'] = (bool) LikeService::liked($user->profile_id, $k);
|
||||
$status['bookmarked'] = (bool) BookmarkService::get($user->profile_id, $k);
|
||||
$status['reblogged'] = (bool) ReblogService::get($user->profile_id, $k);
|
||||
|
@ -411,7 +411,7 @@ class PublicApiController extends Controller
|
|||
return $status;
|
||||
})
|
||||
->filter(function($s) use($filtered) {
|
||||
return isset($s['account']) && in_array($s['account']['id'], $filtered) == false;
|
||||
return $s && isset($s['account']) && in_array($s['account']['id'], $filtered) == false;
|
||||
})
|
||||
->values()
|
||||
->toArray();
|
||||
|
|
Loading…
Reference in a new issue