Fixes error 500 if checkout_acceptances table have a created_at null column
This commit is contained in:
parent
40bc13a946
commit
e5cc6ec972
1 changed files with 5 additions and 1 deletions
|
@ -1006,7 +1006,11 @@ class ReportsController extends Controller
|
||||||
}
|
}
|
||||||
$assetItem = $acceptance->checkoutable;
|
$assetItem = $acceptance->checkoutable;
|
||||||
|
|
||||||
$logItem = $assetItem->checkouts()->where('created_at', '=', $acceptance->created_at)->get()[0];
|
if (is_null($acceptance->created_at)){
|
||||||
|
return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.bad_data'));
|
||||||
|
} else {
|
||||||
|
$logItem = $assetItem->checkouts()->where('created_at', '=', $acceptance->created_at)->get()[0];
|
||||||
|
}
|
||||||
|
|
||||||
if(!$assetItem->assignedTo->locale){
|
if(!$assetItem->assignedTo->locale){
|
||||||
Notification::locale(Setting::getSettings()->locale)->send(
|
Notification::locale(Setting::getSettings()->locale)->send(
|
||||||
|
|
Loading…
Add table
Reference in a new issue