Fix NullPointerException

This commit is contained in:
filoghost 2020-10-18 10:01:32 +02:00
parent 6ff57d5aa2
commit a502f64357

View File

@ -60,6 +60,9 @@ public class PlaceholderRegistry {
} }
Map<String, Placeholder> externalPlaceholdersByPlugin = externalPlaceholders.get(identifier); Map<String, Placeholder> externalPlaceholdersByPlugin = externalPlaceholders.get(identifier);
if (externalPlaceholdersByPlugin == null) {
return null;
}
// Find exact replacer if plugin name is specified // Find exact replacer if plugin name is specified
if (placeholderMatch.getPluginNamespace() != null) { if (placeholderMatch.getPluginNamespace() != null) {
@ -67,7 +70,7 @@ public class PlaceholderRegistry {
} }
// Otherwise try find the first one registered // Otherwise try find the first one registered
if (externalPlaceholdersByPlugin != null && !externalPlaceholdersByPlugin.isEmpty()) { if (!externalPlaceholdersByPlugin.isEmpty()) {
return externalPlaceholdersByPlugin.values().iterator().next(); return externalPlaceholdersByPlugin.values().iterator().next();
} }