Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix #7514
James Cole15f683ef7e4f
diff --git a/app/Handlers/Events/Model/BudgetLimitHandler.php b/app/Handlers/Events/Model/BudgetLimitHandler.phpindex c873c2d96d..235c0c9c19 100644--- a/app/Handlers/Events/Model/BudgetLimitHandler.php+++ b/app/Handlers/Events/Model/BudgetLimitHandler.php@@ -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.