mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-23 14:26:58 +00:00
Fix possible null pointer.
This commit is contained in:
@@ -238,12 +238,15 @@ class BoxController extends Controller
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
$accountCurrency = $currency;
|
||||
$accountCurrency = null;
|
||||
$balance = $balances[$account->id] ?? '0';
|
||||
$currencyId = (int)$repository->getMetaValue($account, 'currency_id');
|
||||
if ($currencyId !== 0) {
|
||||
$accountCurrency = $currencyRepos->findNull($currencyId);
|
||||
}
|
||||
if (null === $accountCurrency) {
|
||||
$accountCurrency = $currency;
|
||||
}
|
||||
|
||||
// if the account is a credit card, subtract the virtual balance from the balance,
|
||||
// to better reflect that this is not money that is actually "yours".
|
||||
|
Reference in New Issue
Block a user