From 6936d76661295381542215a2142e0490e26b24c2 Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Mon, 1 May 2023 16:50:18 -0600 Subject: [PATCH] Prevent hard fail when retrieving acceptance data --- app/Http/Controllers/Account/AcceptanceController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Http/Controllers/Account/AcceptanceController.php b/app/Http/Controllers/Account/AcceptanceController.php index 726e164ba8..7644488a89 100644 --- a/app/Http/Controllers/Account/AcceptanceController.php +++ b/app/Http/Controllers/Account/AcceptanceController.php @@ -159,6 +159,9 @@ class AcceptanceController extends Controller case 'App\Models\Asset': $pdf_view_route ='account.accept.accept-asset-eula'; $asset_model = AssetModel::find($item->model_id); + if (!$asset_model) { + return redirect()->back()->with('error', trans('admin/models/message.does_not_exist')); + } $display_model = $asset_model->name; $assigned_to = User::find($acceptance->assigned_to_id)->present()->fullName; break;