Merge pull request #7515 from firefly-iii/fix-7514

Fix #7514
This commit is contained in:
James Cole
2023-05-17 15:20:09 +02:00
committed by GitHub

View File

@@ -182,6 +182,11 @@ class BudgetLimitHandler
$end = app('navigation')->startOfPeriod($budgetLimit->end_date, $viewRange);
$end = app('navigation')->endOfPeriod($end, $viewRange);
$budget = Budget::withTrashed()->find($budgetLimit->budget_id);
if(null === $budget) {
Log::warning('Budget is null, cannot continue.');
$budgetLimit->forceDelete();
return;
}
$user = $budget->user;
// sanity check. It happens when the budget has been deleted so the original user is unknown.