From 5707df023985ecd9efdb11fb072e1c12ab179237 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 9 Apr 2020 18:32:34 -0700 Subject: [PATCH] Check that location isset in checkout --- app/Models/Asset.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index f04c541c64..b6ee3f2518 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -226,10 +226,10 @@ class Asset extends Depreciable if ($location != null) { $this->location_id = $location; } else { - if($target->location) { + if (isset($target->location)) { $this->location_id = $target->location->id; } - if($target instanceof Location) { + if ($target instanceof Location) { $this->location_id = $target->id; } }