Skip to content

A free open source IT asset/license management system

fix custom field value conditional check

Godfrey Me4f8c1ba3f25
diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.php
index 86cb8e5d02..60d7bfb10f 100644
--- a/app/Importer/AssetImporter.php
+++ b/app/Importer/AssetImporter.php
@@ -40,11 +40,11 @@ class AssetImporter extends ItemImporter
// ItemImporter handles the general fetching.
parent::handle($row);
- if (!is_null($this->customFields)) {
+ if ($this->customFields) {
foreach ($this->customFields as $customField) {
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
- if ($customFieldValue) {
+ if (!is_null($customFieldValue)) {
if ($customField->field_encrypted == 1) {
$this->item['custom_fields'][$customField->db_column_name()] = Crypt::encrypt($customFieldValue);
$this->log('Custom Field '.$customField->name.': '.Crypt::encrypt($customFieldValue));