From d150b22eaea7879057ce49ea090b20f11862dfad Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 26 Jan 2017 21:05:44 +0000 Subject: [PATCH] fix NPE on login --- .../me/lucko/luckperms/bukkit/model/LPPermissible.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/LPPermissible.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/LPPermissible.java index 544c1239..c3429067 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/LPPermissible.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/model/LPPermissible.java @@ -29,6 +29,7 @@ import lombok.Setter; import me.lucko.luckperms.api.Contexts; import me.lucko.luckperms.api.Tristate; import me.lucko.luckperms.bukkit.LPBukkitPlugin; +import me.lucko.luckperms.common.caching.UserCache; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.core.model.User; @@ -93,7 +94,12 @@ public class LPPermissible extends PermissibleBase { } public void updateSubscriptions() { - Set ent = new HashSet<>(user.getUserData().getPermissionData(calculateContexts()).getImmutableBacking().keySet()); + UserCache cache = user.getUserData(); + if (cache == null) { + return; + } + + Set ent = new HashSet<>(cache.getPermissionData(calculateContexts()).getImmutableBacking().keySet()); if (parent.isOp()) { ent.addAll(plugin.getDefaultsProvider().getOpDefaults().keySet());