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
commit 6d532470e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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