mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Added Guard Clause to License Importer to return if no empty seat is found
This commit is contained in:
parent
b0f4015bb4
commit
ddabe7cc9f
|
@ -80,6 +80,11 @@ class LicenseImporter extends ItemImporter
|
|||
$checkout_target = $this->item['checkout_target'];
|
||||
$asset = Asset::where('asset_tag', $asset_tag)->first();
|
||||
$targetLicense = $license->freeSeat();
|
||||
|
||||
if (is_null($targetLicense)){
|
||||
return;
|
||||
}
|
||||
|
||||
if ($checkout_target) {
|
||||
$targetLicense->assigned_to = $checkout_target->id;
|
||||
$targetLicense->user_id = Auth::id();
|
||||
|
|
Loading…
Reference in a new issue