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;