From 25e3abeeb83eb76e2d35322bdbfe02d50ad358e3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 2 Jan 2024 16:29:47 +0100 Subject: [PATCH] Fix https://github.com/firefly-iii/firefly-iii/issues/8320 --- app/Support/Http/Api/SummaryBalanceGrouped.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Support/Http/Api/SummaryBalanceGrouped.php b/app/Support/Http/Api/SummaryBalanceGrouped.php index 38146ccc3a..14040544e6 100644 --- a/app/Support/Http/Api/SummaryBalanceGrouped.php +++ b/app/Support/Http/Api/SummaryBalanceGrouped.php @@ -81,7 +81,7 @@ class SummaryBalanceGrouped public function groupData(): array { - \Log::debug('Now going to group data.'); + Log::debug('Now going to group data.'); $return = []; foreach ($this->keys as $key) { $title = match ($key) { @@ -90,6 +90,8 @@ class SummaryBalanceGrouped 'income' => 'earned', default => 'something' }; + + $return[] = [ 'key' => sprintf('%s-in-native', $title), 'value' => $this->amounts[$key]['native'] ?? '0', @@ -100,7 +102,7 @@ class SummaryBalanceGrouped ]; } // loop 3: format amounts: - $currencyIds = array_keys($this->amounts[self::SUM]); + $currencyIds = array_keys($this->amounts[self::SUM] ?? []); foreach ($currencyIds as $currencyId) { if ('native' === $currencyId) { // skip native entries.