Better fix for nullpointer.

This commit is contained in:
James Cole
2025-02-20 08:08:07 +01:00
parent 2e3669a32f
commit 334a521ca1

View File

@@ -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));
}
}