From 732a85e51d84aa7cbc5c9e3db754a23d8eb7d2c1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 6 Apr 2016 21:07:03 +0200 Subject: [PATCH] Fix null call --- app/Repositories/Category/CategoryRepository.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index af4544c458..d8e1486bca 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -248,7 +248,12 @@ class CategoryRepository implements CategoryRepositoryInterface */ public function sumSpentNoCategory(Collection $accounts, Carbon $start, Carbon $end): string { - return $this->sumNoCategory($accounts, $start, $end, self::SPENT); + $sum = $this->sumNoCategory($accounts, $start, $end, self::SPENT); + if (is_null($sum)) { + return '0'; + } + + return $sum; } /**