mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge pull request #12763 from inietov/fixes/call_to_member_function_licenses_on_null
Fixed Call to a Member Function Licenses() on null [sc-20606]
This commit is contained in:
commit
cfef9d8cca
|
@ -463,7 +463,7 @@ class AssetsController extends Controller
|
|||
{
|
||||
$this->authorize('view', Asset::class);
|
||||
$this->authorize('view', License::class);
|
||||
$asset = Asset::where('id', $id)->withTrashed()->first();
|
||||
$asset = Asset::where('id', $id)->withTrashed()->firstorfail();
|
||||
$licenses = $asset->licenses()->get();
|
||||
|
||||
return (new LicensesTransformer())->transformLicenses($licenses, $licenses->count());
|
||||
|
|
Loading…
Reference in a new issue