Skip to content

Firefly III: a personal finances manager

Fix nulls

James Cole1b68e5374ad1
diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php
index a069639647..6226fa4141 100644
--- a/app/Factory/TransactionJournalFactory.php
+++ b/app/Factory/TransactionJournalFactory.php
@@ -178,8 +178,8 @@ class TransactionJournalFactory
$currency = $this->currencyRepository->findCurrency(((int) $row['currency_id'] ?? 0), (string) ($row['currency_code'] ?? ''));
Log::debug('Find foreign currency or return NULL.');
- $foreignCurrency = $this->currencyRepository->findCurrencyNull($row['foreign_currency_id'], $row['foreign_currency_code']);
- $bill = $this->billRepository->findBill((int) $row['bill_id'], $row['bill_name']);
+ $foreignCurrency = $this->currencyRepository->findCurrencyNull($row['foreign_currency_id'] ?? 0, $row['foreign_currency_code'] ?? '');
+ $bill = $this->billRepository->findBill(((int) $row['bill_id'] ?? 0, $row['bill_name'] ?? '');
$billId = TransactionTypeEnum::WITHDRAWAL->value === $type->type && $bill instanceof Bill ? $bill->id : null;
$description = (string) $row['description'];