Skip to content

A free open source IT asset/license management system

Check that location isset in checkout

snipe5707df023985
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;
}
}