From 1b31d208771f532ebde3b76e1a62eb7c017a22a2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 27 Jun 2020 09:56:38 +0200 Subject: [PATCH] Skip deleted piggies. --- .../TransactionGroup/TransactionGroupRepository.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php index 962b4b8f5f..669ece4102 100644 --- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php +++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php @@ -277,6 +277,9 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface ->get(['piggy_bank_events.*']); /** @var PiggyBankEvent $row */ foreach ($data as $row) { + if(null === $row->piggyBank) { + continue; + } // get currency preference. $currencyPreference = AccountMeta ::where('account_id', $row->piggyBank->account_id)