Fixed NPE

This commit is contained in:
Norbi Peti 2016-11-02 22:00:21 +01:00
parent dded17bf70
commit 1c2b373bd7

View file

@ -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;
}