Эх сурвалжийг харах

[libgdx] Need to check for null attachment in internal entries.

badlogic 6 жил өмнө
parent
commit
829fcc4168

+ 3 - 2
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java

@@ -80,9 +80,10 @@ public class Skin {
 
 		for (SkinEntry entry : skin.attachments.keys()) {
 			if (entry.attachment instanceof MeshAttachment)
-				setAttachment(entry.slotIndex, entry.name, ((MeshAttachment)entry.attachment).newLinkedMesh());
+				setAttachment(entry.slotIndex, entry.name,
+					entry.attachment != null ? ((MeshAttachment)entry.attachment).newLinkedMesh() : null);
 			else
-				setAttachment(entry.slotIndex, entry.name, entry.attachment.copy());
+				setAttachment(entry.slotIndex, entry.name, entry.attachment != null ? entry.attachment.copy() : null);
 		}
 	}