diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php index a744db578850..932176286f72 100644 --- a/app/Http/Controllers/Assets/BulkAssetsController.php +++ b/app/Http/Controllers/Assets/BulkAssetsController.php @@ -58,8 +58,14 @@ public function edit(Request $request) switch ($request->input('bulk_actions')) { case 'labels': $this->authorize('view', Asset::class); + $assets_found = Asset::find($asset_ids); + + if ($assets_found->isEmpty()){ + return redirect()->back(); + } + return (new Label) - ->with('assets', Asset::find($asset_ids)) + ->with('assets', $assets_found) ->with('settings', Setting::getSettings()) ->with('bulkedit', true) ->with('count', 0); diff --git a/app/View/Label.php b/app/View/Label.php index bbba1605b78a..d581548eb303 100644 --- a/app/View/Label.php +++ b/app/View/Label.php @@ -39,10 +39,6 @@ public function render(callable $callback = null) $assets = $this->data->get('assets'); $offset = $this->data->get('offset'); $template = $this->data->get('template'); - - if ($assets->isEmpty()){ - return redirect()->back(); - } // If disabled, pass to legacy view if ((!$settings->label2_enable) && (!$template)) {