mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-05 06:28:53 +00:00
Fix NPE in message source
This commit is contained in:
1 parent
294fc8deb4
commit
ce99584306
1 file changed
+7
-1
@@ -196,7 +196,10 @@ public final class CarbonMessageSource implements IMessageSource<Audience, Strin
|
||||
}
|
||||
|
||||
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 (defaultProperties != null) {
|
||||
final String value = defaultProperties.getProperty(key);
|
||||
|
||||
if (value == null) {
|
||||
this.logger.warn("No message mapping for key " + key + " in default locale " + this.defaultLocale.getDisplayName());
|
||||
@@ -206,6 +209,9 @@ public final class CarbonMessageSource implements IMessageSource<Audience, Strin
|
||||
return value;
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
private void walkPluginJar(final Consumer<Stream<Path>> user) throws IOException {
|
||||
if (Files.isDirectory(this.pluginJar)) {
|
||||
try (final var stream = Files.walk(this.pluginJar)) {
|
||||
|
||||
Reference in new issue
Block a user