A free open source IT asset/license management system
Fixed [RB-4105] - check for item’s existance before applying withTrashed()
snipee446dc1cbabd
diff --git a/app/Http/Controllers/Api/ReportsController.php b/app/Http/Controllers/Api/ReportsController.phpindex 35a2257881..8758a15ca1 100644--- a/app/Http/Controllers/Api/ReportsController.php+++ b/app/Http/Controllers/Api/ReportsController.php@@ -30,13 +30,13 @@ class ReportsController extends Controllerif (($request->filled('target_type')) && ($request->filled('target_id'))) {$target = Helper::normalizeFullModelName(request()->input('target_type'));- $target::find(request()->input('target_id'))->withTrashed();+ $target::find(request()->input('target_id'))?->withTrashed();$this->authorize('view', $target);}if (($request->filled('item_type')) && ($request->filled('item_id'))) {$item = Helper::normalizeFullModelName(request()->input('item_type'));- $item::find(request()->input('item_id'))->withTrashed();+ $item::find(request()->input('item_id'))?->withTrashed();$this->authorize('view', $item);}