浏览代码

[lua] Closes #739, bug in Skeleton:getBounds, need to nil check attachment

badlogic 9 年之前
父节点
当前提交
e93e9e77c4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      spine-lua/Skeleton.lua

+ 1 - 1
spine-lua/Skeleton.lua

@@ -439,7 +439,7 @@ function Skeleton:getBounds(offset, size)
 			for i, slot in ipairs(drawOrder) do
 				local vertices = nil
 				local attachment = slot.attachment
-				if attachment.type == AttachmentType.region or attachment.type == AttachmentType.mesh then
+				if attachment and (attachment.type == AttachmentType.region or attachment.type == AttachmentType.mesh) then
 					vertices = attachment:updateWorldVertices(slot, false);
 				end
 				if vertices then