diff --git a/spine-lua/Skeleton.lua b/spine-lua/Skeleton.lua index a96666d6d..d394cb3ea 100644 --- a/spine-lua/Skeleton.lua +++ b/spine-lua/Skeleton.lua @@ -40,6 +40,8 @@ local Color = require "spine-lua.Color" local setmetatable = setmetatable local ipairs = ipairs local table_insert = table.insert +local math_min = math.min +local math_max = math.max local Skeleton = {} Skeleton.__index = Skeleton @@ -481,7 +483,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