Fix null pointer

This commit is contained in:
James Cole
2024-03-24 14:11:30 +01:00
parent 7186f0ef60
commit 0b6877a20e

View File

@@ -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.