Merge pull request #13547 from inietov/fixes/Attempt_to_read_property_asset_tag

Fixed ErrorException: Attempt to read property "asset_tag" on null (rollbar #3541)
This commit is contained in:
snipe 2023-09-05 20:26:21 +01:00 committed by GitHub
commit a67888f3d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,8 +58,14 @@ class BulkAssetsController extends Controller
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);