From 96fe62400f392e2e9e467394afe4b5dd619eb219 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 20 Apr 2024 07:38:05 +0200 Subject: [PATCH] Fix undefined index --- app/Api/V1/Controllers/Models/Transaction/UpdateController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Api/V1/Controllers/Models/Transaction/UpdateController.php b/app/Api/V1/Controllers/Models/Transaction/UpdateController.php index a1df35fa95..d76fef9210 100644 --- a/app/Api/V1/Controllers/Models/Transaction/UpdateController.php +++ b/app/Api/V1/Controllers/Models/Transaction/UpdateController.php @@ -73,7 +73,8 @@ class UpdateController extends Controller $data = $request->getAll(); // Fixes 8750. - foreach ($data['transactions'] as $index => $info) { + $transactions = $data['transactions'] ?? []; + foreach ($transactions as $index => $info) { unset($data['transactions'][$index]['type']); }