From 983b78edd936752727bb2a35ea6af595eb593497 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 2 Dec 2024 14:27:04 -0800 Subject: [PATCH] add property check --- 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 303d608e15..51484fe216 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -1154,14 +1154,14 @@ class ReportsController extends Controller } // Only send notification if assigned - if ($assetItem->assignedTo->email) { + if ($assetItem->assignedTo?->email) { Mail::to($assetItem->assignedTo->email)->send((new CheckoutAssetMail($assetItem, $assetItem->assignedTo, $logItem->user, $logItem->note, $acceptance))->locale($assetItem->assignedTo?->locale)); } else { Mail::to($assetItem->assignedTo->email)->send((new CheckoutAssetMail($assetItem, $assetItem->assignedTo, $logItem->user, $logItem->note, $acceptance))); } - if ($assetItem->assignedTo->email == ''){ + if ($assetItem->assignedTo?->email == ''){ return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.no_email')); }