From c9e6a75ea886bbcb41928729705d76ce4f76e204 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 5 Dec 2017 11:28:48 -0800 Subject: [PATCH] Make sure there is a valid status label associated withthe asset when checking if deployable --- app/Models/Asset.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 15510e8588..230f4c7db8 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -128,7 +128,11 @@ class Asset extends Depreciable public function availableForCheckout() { - if ((empty($this->assigned_to)) && (empty($this->deleted_at)) && ($this->assetstatus->deployable == 1)) { + if ( + (empty($this->assigned_to)) && + (empty($this->deleted_at)) && + (($this->assetstatus) && ($this->assetstatus->deployable == 1))) + { return true; } return false;