From 7f2a3fe0139bb8e0d96aa82ebe500addefcaa40f Mon Sep 17 00:00:00 2001 From: ljurow <50641800+ljurow@users.noreply.github.com> Date: Tue, 18 Feb 2025 01:42:26 -0700 Subject: [PATCH] [ts][threejs] Skin.attachAll() null check (#2755) --- spine-haxe/spine-haxe/spine/Skin.hx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spine-haxe/spine-haxe/spine/Skin.hx b/spine-haxe/spine-haxe/spine/Skin.hx index 769cdddac..56e9da5aa 100644 --- a/spine-haxe/spine-haxe/spine/Skin.hx +++ b/spine-haxe/spine-haxe/spine/Skin.hx @@ -228,13 +228,15 @@ class Skin { var slotAttachment:Attachment = slot.attachment; if (slotAttachment != null && slotIndex < oldSkin.attachments.length) { var dictionary:StringMap = oldSkin.attachments[slotIndex]; - for (name in dictionary.keys()) { - var skinAttachment:Attachment = dictionary.get(name); - if (slotAttachment == skinAttachment) { - var attachment:Attachment = getAttachment(slotIndex, name); - if (attachment != null) - slot.attachment = attachment; - break; + if (null != dictionary) { + for (name in dictionary.keys()) { + var skinAttachment:Attachment = dictionary.get(name); + if (slotAttachment == skinAttachment) { + var attachment:Attachment = getAttachment(slotIndex, name); + if (attachment != null) + slot.attachment = attachment; + break; + } } } }