From 56b2fa69bcd2ca226a972332c8cbe86b3f879c1d Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 9 Apr 2021 09:02:00 +0200 Subject: [PATCH] Fix for #4625 --- app/Support/Form/CurrencyForm.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Support/Form/CurrencyForm.php b/app/Support/Form/CurrencyForm.php index e27d167150..ad5fa7eef4 100644 --- a/app/Support/Form/CurrencyForm.php +++ b/app/Support/Form/CurrencyForm.php @@ -75,6 +75,9 @@ class CurrencyForm // perhaps the currency has been sent to us in the field $amount_currency_id_$name (amount_currency_id_amount) $preFilled = session('preFilled'); + if (!is_array($preFilled)) { + $preFilled = []; + } $key = 'amount_currency_id_' . $name; $sentCurrencyId = array_key_exists($key, $preFilled) ? (int)$preFilled[$key] : $defaultCurrency->id; @@ -140,7 +143,10 @@ class CurrencyForm unset($options['currency'], $options['placeholder']); // perhaps the currency has been sent to us in the field $amount_currency_id_$name (amount_currency_id_amount) - $preFilled = session('preFilled'); + $preFilled = session('preFilled'); + if (!is_array($preFilled)) { + $preFilled = []; + } $key = 'amount_currency_id_' . $name; $sentCurrencyId = array_key_exists($key, $preFilled) ? (int)$preFilled[$key] : $defaultCurrency->id;