From b0e30dbcdc1f05599cdefef62a1c861bea0ae97e Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Tue, 2 Jan 2018 03:01:24 -0500 Subject: [PATCH] Fix freeze when skull texture payload has no id. --- .../java/com/voxelmodpack/hdskins/HDSkinManager.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java index 29a58ccb..307931b1 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java @@ -83,10 +83,17 @@ public final class HDSkinManager implements IResourceManagerReloadListener { // uuid is required if (uuid != null) 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; + // cannot get texture without id! + if (profile.getId() == null) return Optional.empty(); + if (!this.skinCache.containsKey(profile.getId())) { this.skinCache.put(profile.getId(), Maps.newHashMap()); }