From cf986925a0adb80226892d9c3711f96b8a1180d4 Mon Sep 17 00:00:00 2001 From: tastybento Date: Tue, 17 Mar 2020 23:13:38 -0700 Subject: [PATCH] Added protection in against a misnamed default language tag. --- .../java/world/bentobox/bentobox/managers/LocalesManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/LocalesManager.java b/src/main/java/world/bentobox/bentobox/managers/LocalesManager.java index e73359560..a2379eae5 100644 --- a/src/main/java/world/bentobox/bentobox/managers/LocalesManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/LocalesManager.java @@ -90,7 +90,8 @@ public class LocalesManager { @Nullable public String get(String reference) { // 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); } // Get the translation from the en-US locale