Make sure there is a valid status label associated withthe asset when checking if deployable

This commit is contained in:
snipe 2017-12-05 11:28:48 -08:00
parent 7efa7ec03f
commit c9e6a75ea8

View file

@ -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;