mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
prevent a crash when a skin has no attachments. (#2114)
This commit is contained in:
parent
3cdfb25a48
commit
85af0f6580
@ -508,9 +508,9 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) {
|
|||||||
skeletonData->_defaultSkin = skin;
|
skeletonData->_defaultSkin = skin;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (attachmentsMap = Json::getItem(skinMap,
|
Json *attachments = Json::getItem(skinMap, "attachments");
|
||||||
"attachments")
|
if (attachments)
|
||||||
->_child;
|
for (attachmentsMap = attachments->_child;
|
||||||
attachmentsMap; attachmentsMap = attachmentsMap->_next) {
|
attachmentsMap; attachmentsMap = attachmentsMap->_next) {
|
||||||
SlotData *slot = skeletonData->findSlot(attachmentsMap->_name);
|
SlotData *slot = skeletonData->findSlot(attachmentsMap->_name);
|
||||||
Json *attachmentMap;
|
Json *attachmentMap;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user