mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +00:00
Fix NPE in message source
This commit is contained in:
1 parent
294fc8deb4
commit
ce99584306
1 file changed
+11
-5
@@ -196,14 +196,20 @@ public final class CarbonMessageSource implements IMessageSource<Audience, Strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String forAudience(final String key, final Audience audience) {
|
private String forAudience(final String key, final Audience audience) {
|
||||||
final String value = this.locales.get(this.defaultLocale).getProperty(key);
|
final Properties defaultProperties = this.locales.get(this.defaultLocale);
|
||||||
|
|
||||||
if (value == null) {
|
if (defaultProperties != null) {
|
||||||
this.logger.warn("No message mapping for key " + key + " in default locale " + this.defaultLocale.getDisplayName());
|
final String value = defaultProperties.getProperty(key);
|
||||||
return key;
|
|
||||||
|
if (value == null) {
|
||||||
|
this.logger.warn("No message mapping for key " + key + " in default locale " + this.defaultLocale.getDisplayName());
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void walkPluginJar(final Consumer<Stream<Path>> user) throws IOException {
|
private void walkPluginJar(final Consumer<Stream<Path>> user) throws IOException {
|
||||||
|
|||||||
Reference in new issue
Block a user