diff --git a/core/src/main/java/bisq/core/locale/GlobalSettings.java b/core/src/main/java/bisq/core/locale/GlobalSettings.java index 46856fd7a9..339124aab1 100644 --- a/core/src/main/java/bisq/core/locale/GlobalSettings.java +++ b/core/src/main/java/bisq/core/locale/GlobalSettings.java @@ -23,6 +23,9 @@ import javafx.beans.property.SimpleObjectProperty; import java.util.Locale; +import lombok.extern.slf4j.Slf4j; + +@Slf4j public class GlobalSettings { private static boolean useAnimations = true; private static Locale locale; @@ -32,6 +35,7 @@ public class GlobalSettings { static { locale = Locale.getDefault(); + log.info("Locale info: {}", locale); // On some systems there is no country defined, in that case we use en_US if (locale.getCountry() == null || locale.getCountry().isEmpty()) diff --git a/core/src/main/java/bisq/core/user/Preferences.java b/core/src/main/java/bisq/core/user/Preferences.java index 1cff31f2e2..dc7e1a0dae 100644 --- a/core/src/main/java/bisq/core/user/Preferences.java +++ b/core/src/main/java/bisq/core/user/Preferences.java @@ -277,8 +277,13 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid prefPayload.setUserLanguage(GlobalSettings.getLocale().getLanguage()); prefPayload.setUserCountry(CountryUtil.getDefaultCountry()); GlobalSettings.setLocale(new Locale(prefPayload.getUserLanguage(), prefPayload.getUserCountry().code)); - TradeCurrency preferredTradeCurrency = checkNotNull(CurrencyUtil.getCurrencyByCountryCode(prefPayload.getUserCountry().code), - "preferredTradeCurrency must not be null"); + + TradeCurrency preferredTradeCurrency = CurrencyUtil.getCurrencyByCountryCode("US"); // default fallback option + try { + preferredTradeCurrency = CurrencyUtil.getCurrencyByCountryCode(prefPayload.getUserCountry().code); + } catch (IllegalArgumentException ia) { + log.warn("Could not determine currency for country {} [{}]", prefPayload.getUserCountry().code, ia.toString()); + } prefPayload.setPreferredTradeCurrency(preferredTradeCurrency); setFiatCurrencies(CurrencyUtil.getMainFiatCurrencies()); setCryptoCurrencies(CurrencyUtil.getMainCryptoCurrencies());