[ts][threejs] Skin.attachAll() null check (#2755)

This commit is contained in:
ljurow 2025-02-18 01:42:26 -07:00 committed by GitHub
parent bd1b98fe97
commit 7f2a3fe013
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -228,6 +228,7 @@ class Skin {
var slotAttachment:Attachment = slot.attachment; var slotAttachment:Attachment = slot.attachment;
if (slotAttachment != null && slotIndex < oldSkin.attachments.length) { if (slotAttachment != null && slotIndex < oldSkin.attachments.length) {
var dictionary:StringMap<Attachment> = oldSkin.attachments[slotIndex]; var dictionary:StringMap<Attachment> = oldSkin.attachments[slotIndex];
if (null != dictionary) {
for (name in dictionary.keys()) { for (name in dictionary.keys()) {
var skinAttachment:Attachment = dictionary.get(name); var skinAttachment:Attachment = dictionary.get(name);
if (slotAttachment == skinAttachment) { if (slotAttachment == skinAttachment) {
@ -238,6 +239,7 @@ class Skin {
} }
} }
} }
}
slotIndex++; slotIndex++;
} }
} }