From 334a521ca123a5819dd5a02a8c169b723f376756 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 20 Feb 2025 08:08:07 +0100 Subject: [PATCH] Better fix for nullpointer. --- app/Support/JsonApi/Enrichments/AccountEnrichment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Support/JsonApi/Enrichments/AccountEnrichment.php b/app/Support/JsonApi/Enrichments/AccountEnrichment.php index 4e62c1c0cd..c11fd4562e 100644 --- a/app/Support/JsonApi/Enrichments/AccountEnrichment.php +++ b/app/Support/JsonApi/Enrichments/AccountEnrichment.php @@ -250,8 +250,9 @@ class AccountEnrichment implements EnrichmentInterface foreach ($currencies as $currency) { $this->currencies[(int) $currency->id] = $currency; } + $this->currencies[0] = $this->native; foreach ($this->currencies as $id => $currency) { - if (true === $currency && 0 !== (int) $id) { + if (true === $currency) { throw new FireflyException(sprintf('Currency #%d not found.', $id)); } }