Fix freeze when skull texture payload has no id.

This commit is contained in:
Matthew Messinger 2018-01-02 03:01:24 -05:00
parent ca9743e377
commit b0e30dbcdc

View file

@ -83,10 +83,17 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
// uuid is required // uuid is required
if (uuid != null) if (uuid != null)
profile1 = new GameProfile(uuid, name); profile1 = new GameProfile(uuid, name);
// probably uses this texture for a reason. Don't mess with it.
if (!texturePayload.getTextures().isEmpty() && texturePayload.getProfileId() == null)
return Optional.empty();
} }
} }
final GameProfile profile = profile1; final GameProfile profile = profile1;
// cannot get texture without id!
if (profile.getId() == null) return Optional.empty();
if (!this.skinCache.containsKey(profile.getId())) { if (!this.skinCache.containsKey(profile.getId())) {
this.skinCache.put(profile.getId(), Maps.newHashMap()); this.skinCache.put(profile.getId(), Maps.newHashMap());
} }