This commit is contained in:
James Cole 2023-05-17 15:19:27 +02:00
parent 18ba2e563e
commit 15f683ef7e
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

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.