From 0fa3c2bd8df90d2c695ab7e4a447217dae140532 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 27 Dec 2024 12:39:26 +0100 Subject: [PATCH] Fix issue with prefilled piggy banks. --- app/Factory/PiggyBankFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index babb2a0955..2cbc99e7c8 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -231,8 +231,8 @@ class PiggyBankFactory foreach ($accounts as $info) { if ($account->id === $info['account_id']) { if (array_key_exists($account->id, $accounts)) { - $toBeLinked[$account->id] = ['current_amount' => $account->pivot->current_amount]; - Log::debug(sprintf('Prefilled for account #%d with amount %s', $account->id, $account->pivot->current_amount)); + $toBeLinked[$account->id] = ['current_amount' => $account->pivot->current_amount ?? '0']; + Log::debug(sprintf('Prefilled for account #%d with amount %s', $account->id, $account->pivot->current_amount ?? '0')); } } }