Skip to content

Firefly III: a personal finances manager

Catch null pointer.

James Coleee16888317cd
diff --git a/app/Services/Internal/Recalculate/PrimaryAmountRecalculationService.php b/app/Services/Internal/Recalculate/PrimaryAmountRecalculationService.php
index 1adc513a8e..7950e24b5c 100644
--- a/app/Services/Internal/Recalculate/PrimaryAmountRecalculationService.php
+++ b/app/Services/Internal/Recalculate/PrimaryAmountRecalculationService.php
@@ -202,7 +202,7 @@ class PrimaryAmountRecalculationService
/** @var Account $account */
foreach ($set as $account) {
- $currencyId = (int) $account->accountMeta()->where('name', 'currency_id')->first()->data;
+ $currencyId = (int) $account->accountMeta()->where('name', 'currency_id')->first()?->data;
if ($groupCurrency->id === $currencyId) {
Log::debug(sprintf('Account "%s" is in group currency %s. Skip.', $account->name, $groupCurrency->code));