mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Return null if asset was hard-deleted/purged
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
c12e1f6d6c
commit
3868e711f4
|
@ -521,7 +521,7 @@ class AssetsController extends Controller
|
|||
public function getBarCode($assetId = null)
|
||||
{
|
||||
$settings = Setting::getSettings();
|
||||
$asset = Asset::withTrashed()->find($assetId);
|
||||
if ($asset = Asset::withTrashed()->find($assetId)) {
|
||||
$barcode_file = public_path().'/uploads/barcodes/'.str_slug($settings->alt_barcode).'-'.str_slug($asset->asset_tag).'.png';
|
||||
|
||||
if (isset($asset->id, $asset->asset_tag)) {
|
||||
|
@ -547,6 +547,8 @@ class AssetsController extends Controller
|
|||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a label for an individual asset.
|
||||
|
|
Loading…
Reference in a new issue