Browse Source

Allow attachment loader to return null.

NathanSweet 9 năm trước cách đây
mục cha
commit
ae7ca98b8e

+ 2 - 1
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java

@@ -318,7 +318,8 @@ public class SkeletonBinary {
 			int slotIndex = input.readInt(true);
 			for (int ii = 0, nn = input.readInt(true); ii < nn; ii++) {
 				String name = input.readString();
-				skin.addAttachment(slotIndex, name, readAttachment(input, skin, slotIndex, name, nonessential));
+				Attachment attachment = readAttachment(input, skin, slotIndex, name, nonessential);
+				if (attachment != null) skin.addAttachment(slotIndex, name, attachment);
 			}
 		}
 		return skin;