Skip to content

Firefly III: a personal finances manager

Fix null call

James Cole732a85e51d84
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;
}
/**