mirror of
https://github.com/songoda/EpicHeads.git
synced 2024-11-26 04:25:16 +01:00
Fixed another null.
This commit is contained in:
parent
4da27dbf2a
commit
f6c59c386a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user