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(); $locale = app('steam')->getLocale();
$entries = []; $entries = [];
$amount = $budgetLimit->amount; $amount = $budgetLimit->amount ?? '0';
$budgetCollection = new Collection([$budget]); $budgetCollection = new Collection([$budget]);
$currency = $budgetLimit->transactionCurrency; $currency = $budgetLimit->transactionCurrency;
if ($this->convertToNative) { if ($this->convertToNative) {
$amount = $budgetLimit->native_amount; $amount = $budgetLimit->native_amount ?? '0';
$currency = $this->defaultCurrency; $currency = $this->defaultCurrency;
} }
while ($start <= $end) { while ($start <= $end) {
$current = clone $start; $current = clone $start;
$expenses = $this->opsRepository->sumExpenses($current, $current, null, $budgetCollection, $budgetLimit->transactionCurrency); $expenses = $this->opsRepository->sumExpenses($current, $current, null, $budgetCollection, $budgetLimit->transactionCurrency);