Skip to content

A free open source IT asset/license management system

Adds a check for empty location values on import

Ivan Nieto Vivancoe267f5491aa9
diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.php
index f015de04d9..d332200368 100644
--- a/app/Importer/ItemImporter.php
+++ b/app/Importer/ItemImporter.php
@@ -112,7 +112,7 @@ class ItemImporter extends Importer
return $this->createOrFetchUser($row);
}
- if (strtolower($this->item['checkout_class']) === 'location') {
+ if (strtolower($this->item['checkout_class']) === 'location' && $this->findCsvMatch($row, 'checkout_location') != null ) {
return Location::findOrFail($this->createOrFetchLocation($this->findCsvMatch($row, 'checkout_location')));
}