Fix nullpointer.

This commit is contained in:
James Cole 2025-02-09 09:35:26 +01:00
parent 53e46895aa
commit 3aa946e028
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -168,15 +168,14 @@ class BudgetController extends Controller
}
$locale = app('steam')->getLocale();
$entries = [];
$amount = $budgetLimit->amount;
$amount = $budgetLimit->amount ?? '0';
$budgetCollection = new Collection([$budget]);
$currency = $budgetLimit->transactionCurrency;
if ($this->convertToNative) {
$amount = $budgetLimit->native_amount;
$amount = $budgetLimit->native_amount ?? '0';
$currency = $this->defaultCurrency;
}
while ($start <= $end) {
$current = clone $start;
$expenses = $this->opsRepository->sumExpenses($current, $current, null, $budgetCollection, $budgetLimit->transactionCurrency);