diff --git a/app/Http/Controllers/CollectionController.php b/app/Http/Controllers/CollectionController.php index e168e4ff7..fca16f033 100644 --- a/app/Http/Controllers/CollectionController.php +++ b/app/Http/Controllers/CollectionController.php @@ -175,6 +175,11 @@ class CollectionController extends Controller { $user = $request->user(); $collection = CollectionService::getCollection($id); + + if(!$collection) { + return response()->json([], 404); + } + if($collection['published_at'] == null || $collection['visibility'] != 'public') { abort_unless($user, 404); if($user->profile_id != $collection['pid']) { @@ -192,6 +197,11 @@ class CollectionController extends Controller { $user = $request->user(); $collection = CollectionService::getCollection($id); + + if(!$collection) { + return response()->json([], 404); + } + if($collection['published_at'] == null || $collection['visibility'] != 'public') { abort_unless($user, 404); if($user->profile_id != $collection['pid']) {