From e300314e05c327b3db67d62a3ffeca41a6663f65 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 7 Aug 2025 05:56:31 +0200 Subject: [PATCH] Catch NULL. --- app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php index 8df413ce5c..3253d75d5b 100644 --- a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php +++ b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php @@ -102,11 +102,11 @@ class PiggyBankEnrichment implements EnrichmentInterface if (!array_key_exists($accountId, $this->amounts[$id])) { $this->amounts[$id][$accountId] = [ 'current_amount' => '0', - 'pc_current_amount' => '0', + 'pc_current_amount' => null, ]; } $this->amounts[$id][$accountId]['current_amount'] = bcadd($this->amounts[$id][$accountId]['current_amount'], $item->current_amount); - if (null !== $this->amounts[$id][$accountId]['pc_current_amount']) { + if (null !== $this->amounts[$id][$accountId]['pc_current_amount'] && null !== $item->native_current_amount) { $this->amounts[$id][$accountId]['pc_current_amount'] = bcadd($this->amounts[$id][$accountId]['pc_current_amount'], $item->native_current_amount); } }