From 0a218a37d05311e8f91ab72113852b449818c893 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 29 Sep 2016 10:32:09 -0700 Subject: [PATCH] Check that the user exists before trying to get location id --- app/Http/Controllers/ReportsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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). '"';