mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-30 07:02:20 -08:00
add property check
This commit is contained in:
parent
ab67c48352
commit
983b78edd9
|
@ -1154,14 +1154,14 @@ class ReportsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only send notification if assigned
|
// 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));
|
Mail::to($assetItem->assignedTo->email)->send((new CheckoutAssetMail($assetItem, $assetItem->assignedTo, $logItem->user, $logItem->note, $acceptance))->locale($assetItem->assignedTo?->locale));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Mail::to($assetItem->assignedTo->email)->send((new CheckoutAssetMail($assetItem, $assetItem->assignedTo, $logItem->user, $logItem->note, $acceptance)));
|
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'));
|
return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.no_email'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue