Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
LocaleUtils: don't NPE if no default locale mapping exists (#1239)
Dieser Commit ist enthalten in:
Ursprung
b5f6ada4ae
Commit
7c4868cada
@ -246,6 +246,11 @@ public class LocaleUtils {
|
||||
Map<String, String> localeStrings = LocaleUtils.LOCALE_MAPPINGS.get(locale.toLowerCase());
|
||||
if (localeStrings == null)
|
||||
localeStrings = LocaleUtils.LOCALE_MAPPINGS.get(LanguageUtils.getDefaultLocale());
|
||||
if (localeStrings == null) {
|
||||
// Don't cause a NPE if the locale is STILL missing
|
||||
GeyserConnector.getInstance().getLogger().debug("MISSING DEFAULT LOCALE: " + LanguageUtils.getDefaultLocale());
|
||||
return messageText;
|
||||
}
|
||||
|
||||
return localeStrings.getOrDefault(messageText, messageText);
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren