Skip to content

A free open source IT asset/license management system

Check that the user exists before trying to get location id

snipe0a218a37d053
diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php
index dcc93e0341..f1ac2b7b66 100644
--- a/app/Http/Controllers/ReportsController.php
+++ b/app/Http/Controllers/ReportsController.php
@@ -518,7 +518,7 @@ class ReportsController extends Controller
}
if (e(Input::get('location')) == '1') {
$show_loc = '';
- if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id !='' )) {
+ if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser) && ( $asset->assigneduser->location_id !='' )) {
$location = Location::find($asset->assigneduser->location_id);
if ($location) {
$show_loc .= '"' .e($location->name). '"';