From d03b8c6528fdced41a5347945c301fb3f4ed0bf7 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 Nov 2017 22:25:24 -0800 Subject: [PATCH] Error handling for when log ID has no match on asset accept --- app/Http/Controllers/ViewAssetsController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ViewAssetsController.php b/app/Http/Controllers/ViewAssetsController.php index 6c112ff657..2aa5286757 100755 --- a/app/Http/Controllers/ViewAssetsController.php +++ b/app/Http/Controllers/ViewAssetsController.php @@ -284,9 +284,10 @@ class ViewAssetsController extends Controller public function getAcceptAsset($logID = null) { - if (!$findlog = Actionlog::where('id', $logID)->first()) { - echo 'no record'; - //return redirect()->to('account')->with('error', trans('admin/hardware/message.does_not_exist')); + $findlog = Actionlog::where('id', $logID)->first(); + + if (!$findlog) { + return redirect()->to('account/view-assets')->with('error', 'No matching record.'); } if ($findlog->accepted_id!='') {