From bf4ee18123fa048b492cc729f675a64186da25f5 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 10 Feb 2022 11:58:55 -0600 Subject: [PATCH] Validates if model and model->category exist before return the checkin_email property --- app/Models/Asset.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; + } } /**