Skip to content

Commit

Permalink
add property check
Browse files Browse the repository at this point in the history
  • Loading branch information
Godmartinz committed Dec 2, 2024
1 parent ab67c48 commit 983b78e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/ReportsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1154,14 +1154,14 @@ public function sentAssetAcceptanceReminder(Request $request) : RedirectResponse
}

// 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'));
}

Expand Down

0 comments on commit 983b78e

Please sign in to comment.