mirror of
https://github.com/songoda/EpicHeads.git
synced 2024-12-01 23:14:13 +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");
|
methodGetProfile = clazzCraftPlayer.getMethod("getProfile");
|
||||||
}
|
}
|
||||||
Object craftPlayer = clazzCraftPlayer.cast(player);
|
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();
|
return property.getValue();
|
||||||
} catch (ClassNotFoundException
|
} catch (ClassNotFoundException
|
||||||
| NoSuchMethodException
|
| NoSuchMethodException
|
||||||
|
Loading…
Reference in New Issue
Block a user