Fix a rare null pointer

This commit is contained in:
James Cole 2020-02-10 19:15:35 +01:00
parent 2e3e18d836
commit 2a38c9b4ef
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -168,10 +168,11 @@ class BoxController extends Controller
/** @var array $journal */
foreach ($set as $journal) {
$currencyId = (int)$journal['currency_id'];
$amount = $journal['amount'] ?? '0';
$incomes[$currencyId] = $incomes[$currencyId] ?? '0';
$incomes[$currencyId] = bcadd($incomes[$currencyId], app('steam')->positive($journal['amount']));
$incomes[$currencyId] = bcadd($incomes[$currencyId], app('steam')->positive($amount));
$sums[$currencyId] = $sums[$currencyId] ?? '0';
$sums[$currencyId] = bcadd($sums[$currencyId], app('steam')->positive($journal['amount']));
$sums[$currencyId] = bcadd($sums[$currencyId], app('steam')->positive($amount));
}
// collect expenses