From 378f3f5efaa5dd678b934d4bfee130f11c8d1f6f Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 4 Feb 2017 17:45:26 +0000 Subject: [PATCH] Fix NPE for vault getUserMeta when defaultValue is null and the LP value is also null --- .../me/lucko/luckperms/bukkit/vault/VaultChatHook.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultChatHook.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultChatHook.java index 40c94662..7f2df757 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultChatHook.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultChatHook.java @@ -153,7 +153,12 @@ public class VaultChatHook extends Chat { 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) {