diff --git a/pom.xml b/pom.xml index 00d7499..37f70d7 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 tc.oc.occ Cheaty - 1.2.0-SNAPSHOT + 1.2.1-SNAPSHOT Cheaty A minecraft to discord java plugin for anti-cheat logging diff --git a/src/main/java/tc/oc/occ/cheaty/anticheat/GrimManager.java b/src/main/java/tc/oc/occ/cheaty/anticheat/GrimManager.java index 9dd6d6b..7c2e6a5 100644 --- a/src/main/java/tc/oc/occ/cheaty/anticheat/GrimManager.java +++ b/src/main/java/tc/oc/occ/cheaty/anticheat/GrimManager.java @@ -24,7 +24,16 @@ public GrimManager() { public boolean setPlayerBypass(Player player, boolean shouldBypass) { if (player == null) return false; - GrimUser grimUser = api.getGrimUser(player); + + // Grim can internally throw an NPE when getting a player that is being removed + // This occurs when a player disconnects + GrimUser grimUser; + try { + grimUser = api.getGrimUser(player); + } catch (NullPointerException ignored) { + return false; + } + if (!(grimUser instanceof GrimPlayer)) return false; GrimPlayer grimPlayer = (GrimPlayer) grimUser;