Browse Source

Merge pull request #5514 from pixelfed/staging

Update PublicApiController
daniel 6 tháng trước cách đây
mục cha
commit
13af8c5133
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      app/Http/Controllers/PublicApiController.php

+ 6 - 0
app/Http/Controllers/PublicApiController.php

@@ -730,6 +730,9 @@ class PublicApiController extends Controller
             ->map(function ($s) use ($user) {
                 try {
                     $status = StatusService::get($s->id, false);
+                    if (! $status) {
+                        return false;
+                    }
                 } catch (\Exception $e) {
                     $status = false;
                 }
@@ -740,6 +743,9 @@ class PublicApiController extends Controller
                 return $status;
             })
             ->filter(function ($s) use ($onlyMedia) {
+                if (! $s) {
+                    return false;
+                }
                 if ($onlyMedia) {
                     if (
                         ! isset($s['media_attachments']) ||