James Cole
2023-07-18 06:38:11 +02:00
parent a45a050e7d
commit 15ac6a1195

View File

@@ -77,7 +77,11 @@ class BudgetLimitHandler
$end = app('navigation')->endOfPeriod($end, $viewRange);
$budget = Budget::find($budgetLimit->budget_id);
if (null === $budget) {
Log::warning('Budget is null, cannot continue.');
Log::warning('Budget is null, probably deleted, find deleted version.');
$budget = Budget::withTrashed()->find($budgetLimit->budget_id);
}
if (null === $budget) {
Log::warning('Budget is still null, cannot continue, will delete budget limit.');
$budgetLimit->forceDelete();
return;
}