[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,13 +228,15 @@ 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];
for (name in dictionary.keys()) { if (null != dictionary) {
var skinAttachment:Attachment = dictionary.get(name); for (name in dictionary.keys()) {
if (slotAttachment == skinAttachment) { var skinAttachment:Attachment = dictionary.get(name);
var attachment:Attachment = getAttachment(slotIndex, name); if (slotAttachment == skinAttachment) {
if (attachment != null) var attachment:Attachment = getAttachment(slotIndex, name);
slot.attachment = attachment; if (attachment != null)
break; slot.attachment = attachment;
break;
}
} }
} }
} }