From 59213ed60513ca38695b8eb974de4fac98f4c40a Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 1 Nov 2017 16:30:55 +0100 Subject: [PATCH] Fix possible null pointer [skip ci] --- app/Http/Controllers/BudgetController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index d31bec7c5e..34e6ff5ef3 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -590,7 +590,7 @@ class BudgetController extends Controller $collector = app(JournalCollectorInterface::class); $collector->setAllAssetAccounts()->setRange($end, $currentEnd)->withoutBudget()->withOpposingAccount()->setTypes([TransactionType::WITHDRAWAL]); $set = $collector->getJournals(); - $sum = $set->sum('transaction_amount'); + $sum = $set->sum('transaction_amount') ?? '0'; $journals = $set->count(); $dateStr = $end->format('Y-m-d'); $dateName = Navigation::periodShow($end, $range);