Skip to content

Firefly III: a personal finances manager

Better fix for nullpointer.

James Cole334a521ca123
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));
}
}