A free open source IT asset/license management system
Added Guard Clause to License Importer to return if no empty seat is found
Ivan Nieto Vivancoddabe7cc9f03
diff --git a/app/Importer/LicenseImporter.php b/app/Importer/LicenseImporter.phpindex 894c50bbfa..3bfbf1ee26 100644--- a/app/Importer/LicenseImporter.php+++ b/app/Importer/LicenseImporter.php@@ -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();