From 1c2b373bd7f3dbe80b0f6371d1a29794f2667113 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 2 Nov 2016 22:00:21 +0100 Subject: [PATCH] Fixed NPE --- src/main/java/buttondevteam/lib/TBMCPlayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/buttondevteam/lib/TBMCPlayer.java b/src/main/java/buttondevteam/lib/TBMCPlayer.java index 0390a83..7267799 100644 --- a/src/main/java/buttondevteam/lib/TBMCPlayer.java +++ b/src/main/java/buttondevteam/lib/TBMCPlayer.java @@ -52,7 +52,7 @@ public class TBMCPlayer implements AutoCloseable { if (!mname.startsWith("get")) throw new UnsupportedOperationException("Can only use getData from a getXYZ method"); Object ret = getLoadedPlayers().get(uuid).data.get(mname.substring("get".length()).toLowerCase()); - if (Integer.class.isAssignableFrom(ret.getClass())) + if (ret != null && Integer.class.isAssignableFrom(ret.getClass())) throw new UnsupportedOperationException("For integers use getIntData()"); return (T) ret; }