From a7e12931fa1e76a967711dceb55fa3c652c13524 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 22 Nov 2017 18:42:17 -0800 Subject: [PATCH] Check that assigned is an object in reports controller --- app/Http/Controllers/ReportsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index c60b33fcb3..c646e9e6ef 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -183,8 +183,8 @@ class ReportsController extends Controller ($asset->purchase_cost > 0) ? Helper::formatCurrencyOutput($asset->purchase_cost) : '', ($asset->order_number) ? e($asset->order_number) : '', ($asset->supplier) ? e($asset->supplier->name) : '', - ($asset->checkedOutToUser()) ? e($asset->assigned->getFullNameAttribute()) : ($asset->assigned ? e($asset->assigned->display_name) : ''), - ($asset->checkedOutToUser()) ? 'user' : e($asset->assignedType()), + ($asset->checkedOutToUser() && $asset->assigned) ? e($asset->assigned->getFullNameAttribute()) : ($asset->assigned ? e($asset->assigned->display_name) : ''), + ($asset->checkedOutToUser() && $asset->assigned) ? 'user' : e($asset->assignedType()), ($asset->last_checkout!='') ? e($asset->last_checkout) : '', ($asset->location) ? e($asset->location->name) : '', ($asset->notes) ? e($asset->notes) : '',