Fixed another null.

This commit is contained in:
Brianna 2019-05-12 16:36:59 -04:00
parent 4da27dbf2a
commit f6c59c386a

View File

@ -69,7 +69,12 @@ public class Methods {
methodGetProfile = clazzCraftPlayer.getMethod("getProfile");
}
Object craftPlayer = clazzCraftPlayer.cast(player);
Property property = ((GameProfile) methodGetProfile.invoke(craftPlayer)).getProperties().get("textures").iterator().next();
Iterator<Property> iterator = ((GameProfile) methodGetProfile.invoke(craftPlayer)).getProperties().get("textures").iterator();
if (!iterator.hasNext()) return null;
Property property = iterator.next();
return property.getValue();
} catch (ClassNotFoundException
| NoSuchMethodException