Fixed NPE
This commit is contained in:
parent
aabc2b057f
commit
282adbc098
1 changed files with 2 additions and 0 deletions
|
@ -157,6 +157,8 @@ public class TBMCPlayer implements AutoCloseable {
|
||||||
if (!mname.startsWith("get"))
|
if (!mname.startsWith("get"))
|
||||||
throw new UnsupportedOperationException("Can only use getIntData from a getXYZ method");
|
throw new UnsupportedOperationException("Can only use getIntData from a getXYZ method");
|
||||||
Object obj = getLoadedPlayers().get(uuid).data.get(mname.substring("get".length()).toLowerCase());
|
Object obj = getLoadedPlayers().get(uuid).data.get(mname.substring("get".length()).toLowerCase());
|
||||||
|
if (obj == null)
|
||||||
|
return null;
|
||||||
if (obj instanceof Short)
|
if (obj instanceof Short)
|
||||||
return (T) obj;
|
return (T) obj;
|
||||||
if (!(Integer.class.isAssignableFrom(obj.getClass())))
|
if (!(Integer.class.isAssignableFrom(obj.getClass())))
|
||||||
|
|
Loading…
Reference in a new issue