ソースを参照

Update spine-cocos2dx.cpp

Fixed crash at bounding box function.
flamingo 12 年 前
コミット
817304cecc
1 ファイル変更1 行追加1 行削除
  1. 1 1
      spine-cocos2dx/src/spine/spine-cocos2dx.cpp

+ 1 - 1
spine-cocos2dx/src/spine/spine-cocos2dx.cpp

@@ -192,7 +192,7 @@ CCRect CCSkeleton::boundingBox () {
 	for (int i = 0; i < skeleton->slotCount; ++i) {
 		Slot* slot = skeleton->slots[i];
 		Attachment* attachment = slot->attachment;
-		if (attachment->type != ATTACHMENT_REGION) continue;
+		if (!attachment || attachment->type != ATTACHMENT_REGION) continue;
 		Cocos2dxRegionAttachment* regionAttachment = SUB_CAST(Cocos2dxRegionAttachment, attachment);
 		minX = min(minX, regionAttachment->quad.bl.vertices.x);
 		minY = min(minY, regionAttachment->quad.bl.vertices.y);