mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Prevent errors if image could not be loaded.
This commit is contained in:
parent
d237ed758b
commit
1cf4071cf7
@ -79,13 +79,13 @@ function spine.Skeleton.new (skeletonData, group)
|
|||||||
local image = images[slot]
|
local image = images[slot]
|
||||||
if not attachment then
|
if not attachment then
|
||||||
-- Attachment is gone, remove the image.
|
-- Attachment is gone, remove the image.
|
||||||
if image then
|
if image and image ~= spine.Skeleton.failed then
|
||||||
image:removeSelf()
|
image:removeSelf()
|
||||||
images[slot] = nil
|
images[slot] = nil
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Attachment image has changed.
|
-- Attachment image has changed.
|
||||||
if image and image.attachment ~= attachment then
|
if image and image.attachment ~= attachment and image ~= spine.Skeleton.failed then
|
||||||
image:removeSelf()
|
image:removeSelf()
|
||||||
image = nil
|
image = nil
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user