Skip to content

Firefly III: a personal finances manager

Fix null pointer

James Cole0b6877a20ed2
diff --git a/app/Transformers/V2/AccountTransformer.php b/app/Transformers/V2/AccountTransformer.php
index 74266fa6c5..82cc109cc8 100644
--- a/app/Transformers/V2/AccountTransformer.php
+++ b/app/Transformers/V2/AccountTransformer.php
@@ -179,7 +179,7 @@ class AccountTransformer extends AbstractTransformer
// no currency? use default
$currency = $this->default;
- if (array_key_exists($id, $this->accountMeta) && 0 !== (int)$this->accountMeta[$id]['currency_id']) {
+ if (array_key_exists($id, $this->accountMeta) && 0 !== (int)($this->accountMeta[$id]['currency_id'] ?? 0)) {
$currency = $this->currencies[(int)$this->accountMeta[$id]['currency_id']];
}
// amounts and calculation.