Fix nullpointer

This commit is contained in:
James Cole
2024-12-25 08:14:07 +01:00
parent e8cc321898
commit 6c6d31830b

View File

@@ -54,7 +54,7 @@ abstract class Controller extends BaseController
protected string $dateTimeFormat; protected string $dateTimeFormat;
protected string $monthAndDayFormat; protected string $monthAndDayFormat;
protected bool $convertToNative = false; protected bool $convertToNative = false;
protected TransactionCurrency $defaultCurrency; protected ?TransactionCurrency $defaultCurrency;
protected string $monthFormat; protected string $monthFormat;
protected string $redirectUrl = '/'; protected string $redirectUrl = '/';
@@ -113,10 +113,11 @@ abstract class Controller extends BaseController
$this->monthFormat = (string) trans('config.month_js', [], $locale); $this->monthFormat = (string) trans('config.month_js', [], $locale);
$this->monthAndDayFormat = (string) trans('config.month_and_day_js', [], $locale); $this->monthAndDayFormat = (string) trans('config.month_and_day_js', [], $locale);
$this->dateTimeFormat = (string) trans('config.date_time_js', [], $locale); $this->dateTimeFormat = (string) trans('config.date_time_js', [], $locale);
$this->defaultCurrency = app('amount')->getDefaultCurrency();
$darkMode = 'browser'; $darkMode = 'browser';
$this->defaultCurrency =null;
// get shown-intro-preference: // get shown-intro-preference:
if (auth()->check()) { if (auth()->check()) {
$this->defaultCurrency = app('amount')->getDefaultCurrency();
$language = Steam::getLanguage(); $language = Steam::getLanguage();
$locale = Steam::getLocale(); $locale = Steam::getLocale();
$darkMode = app('preferences')->get('darkMode', 'browser')->data; $darkMode = app('preferences')->get('darkMode', 'browser')->data;