Skip to content

A free open source IT asset/license management system

Validates if model and model->category exist before return the checkin_email property

Ivan Nieto Vivancobf4ee18123fa
diff --git a/app/Models/Asset.php b/app/Models/Asset.php
index a1e94b4510..c57519aa5c 100644
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@ -816,7 +816,9 @@ class Asset extends Depreciable
*/
public function checkin_email()
{
- return $this->model->category->checkin_email;
+ if (($this->model) && ($this->model->category)) {
+ return $this->model->category->checkin_email;
+ }
}
/**