Skip to content

Commit a656931

Browse files
committed
replace null value with missing message error
1 parent ce70540 commit a656931

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/main/java/fr/mrcoq/lib/multilanguageapi/MultiLanguageAPI.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,15 @@ public FileConfiguration getConfig(Lang lang) throws LangFileNotFoundException {
134134
* @throws LangFileNotFoundException
135135
*/
136136
public String getString(Lang lang, String path) throws LangFileNotFoundException {
137-
return getConfig(lang).getString(path);
137+
String value = getConfig(lang).getString(path);
138+
139+
if(value == null) {
140+
String err = "Missing translation value on `" + path + "` in " + lang.getErrorInformation() + ".";
141+
plugin.getLogger().severe(err);
142+
value = "§4" + err + ". Please contact admin.";
143+
}
144+
145+
return value;
138146
}
139147

140148
/**

0 commit comments

Comments
 (0)