Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix unauthenticated get default currency.
James Colefe00c4c3738c
diff --git a/app/Support/Amount.php b/app/Support/Amount.phpindex aea73d2114..13f399e5cc 100644--- a/app/Support/Amount.php+++ b/app/Support/Amount.php@@ -160,10 +160,12 @@ class Amountpublic function getDefaultCurrency(): TransactionCurrency{- /** @var User $user */- $user = auth()->user();-- return $this->getDefaultCurrencyByUserGroup($user->userGroup);+ if(auth()->check()) {+ /** @var User $user */+ $user = auth()->user();+ return $this->getDefaultCurrencyByUserGroup($user->userGroup);+ }+ return $this->getSystemCurrency();}public function getDefaultCurrencyByUserGroup(UserGroup $userGroup): TransactionCurrency