瀏覽代碼

Allow attachment loader to return null.

NathanSweet 9 年之前
父節點
當前提交
ae7ca98b8e
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBinary.java

+ 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;