Fix NPE for vault getUserMeta when defaultValue is null and the LP value is also null

This commit is contained in:
Luck 2017-02-04 17:45:26 +00:00
parent 9b8d6e1dc7
commit 378f3f5efa
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -153,7 +153,12 @@ public class VaultChatHook extends Chat {
return defaultValue; return defaultValue;
} }
return unescapeCharacters(user.getUserData().getMetaData(perms.createContextForWorld(world)).getMeta().getOrDefault(node, defaultValue)); String ret = user.getUserData().getMetaData(perms.createContextForWorld(world)).getMeta().get(node);
if (ret == null) {
return defaultValue;
} else {
return unescapeCharacters(ret);
}
} }
private String getUserChatMeta(boolean prefix, User user, String world) { private String getUserChatMeta(boolean prefix, User user, String world) {