diff --git a/app/Support/Amount.php b/app/Support/Amount.php index aea73d2114..13f399e5cc 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -160,10 +160,12 @@ class Amount public 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