From 282adbc09884d9cab939875108abdc5dea16633f Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 20 Nov 2016 02:44:22 +0100 Subject: [PATCH] Fixed NPE --- src/main/java/buttondevteam/lib/TBMCPlayer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/buttondevteam/lib/TBMCPlayer.java b/src/main/java/buttondevteam/lib/TBMCPlayer.java index 80cd053..203328f 100644 --- a/src/main/java/buttondevteam/lib/TBMCPlayer.java +++ b/src/main/java/buttondevteam/lib/TBMCPlayer.java @@ -157,6 +157,8 @@ public class TBMCPlayer implements AutoCloseable { if (!mname.startsWith("get")) throw new UnsupportedOperationException("Can only use getIntData from a getXYZ method"); Object obj = getLoadedPlayers().get(uuid).data.get(mname.substring("get".length()).toLowerCase()); + if (obj == null) + return null; if (obj instanceof Short) return (T) obj; if (!(Integer.class.isAssignableFrom(obj.getClass())))