mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-22 08:01:24 +01:00
Added protection in against a misnamed default language tag.
This commit is contained in:
parent
5ca51f244e
commit
cf986925a0
@ -90,7 +90,8 @@ public class LocalesManager {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public String get(String reference) {
|
public String get(String reference) {
|
||||||
// Get the translation from the server's locale
|
// Get the translation from the server's locale
|
||||||
if (languages.get(Locale.forLanguageTag(plugin.getSettings().getDefaultLanguage())).contains(reference)) {
|
if (languages.containsKey(Locale.forLanguageTag(plugin.getSettings().getDefaultLanguage()))
|
||||||
|
&& languages.get(Locale.forLanguageTag(plugin.getSettings().getDefaultLanguage())).contains(reference)) {
|
||||||
return languages.get(Locale.forLanguageTag(plugin.getSettings().getDefaultLanguage())).get(reference);
|
return languages.get(Locale.forLanguageTag(plugin.getSettings().getDefaultLanguage())).get(reference);
|
||||||
}
|
}
|
||||||
// Get the translation from the en-US locale
|
// Get the translation from the en-US locale
|
||||||
|
Loading…
Reference in New Issue
Block a user