Fix a few null pointers.

This commit is contained in:
James Cole
2023-12-09 20:12:34 +01:00
parent c37a877f34
commit abd123b1c8
4 changed files with 25 additions and 11 deletions

View File

@@ -103,6 +103,9 @@ class NetWorth implements NetWorthInterface
foreach ($accounts as $account) {
app('log')->debug(sprintf('Now at account #%d ("%s")', $account->id, $account->name));
$currency = $this->getRepository()->getAccountCurrency($account);
if(null === $currency) {
$currency = app('amount')->getDefaultCurrency();
}
$currencyId = $currency->id;
$balance = '0';
$nativeBalance = '0';