Fixed NPE

This commit is contained in:
Norbi Peti 2016-11-20 02:44:22 +01:00
parent aabc2b057f
commit 282adbc098

View file

@ -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())))