Skip to content

A free open source IT asset/license management system

Check that model name exists before trying to display it

snipe715da63581af
diff --git a/app/Models/Asset.php b/app/Models/Asset.php
index 324034992c..a1dc0bd93a 100644
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@ -184,7 +184,7 @@ class Asset extends Depreciable
} else {
$user_name = "Unassigned";
}
- return $this->asset_tag . ' - ' . $this->name . ' (' . $user_name . ') ' . $this->model->name;
+ return $this->asset_tag . ' - ' . $this->name . ' (' . $user_name . ') ' . ($this->model) ? $this->model->name: '';
}
public function validationRules($id = '0')