Catch exceptions.

This commit is contained in:
James Cole
2025-09-07 14:54:44 +02:00
parent 4835b05304
commit 949691935f
8 changed files with 49 additions and 57 deletions

View File

@@ -287,10 +287,8 @@ trait ModifiesPiggyBanks
$piggyBank->name = $data['name'];
}
if (array_key_exists('transaction_currency_id', $data) && is_int($data['transaction_currency_id'])) {
$currency = Amount::getTransactionCurrencyById($data['transaction_currency_id']);
if (null !== $currency) {
$piggyBank->transaction_currency_id = $currency->id;
}
$currency = Amount::getTransactionCurrencyById($data['transaction_currency_id']);
$piggyBank->transaction_currency_id = $currency->id;
}
if (array_key_exists('target_amount', $data) && '' !== $data['target_amount']) {