From 939895c52d79f568dded92e68f24c5f6f212bb82 Mon Sep 17 00:00:00 2001 From: bofeng Date: Thu, 12 Dec 2024 15:39:23 +0800 Subject: [PATCH] refine --- .../editor-support/spine-wasm/spine-wasm.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/native/cocos/editor-support/spine-wasm/spine-wasm.cpp b/native/cocos/editor-support/spine-wasm/spine-wasm.cpp index 1d8d0183046..18024fa31e2 100644 --- a/native/cocos/editor-support/spine-wasm/spine-wasm.cpp +++ b/native/cocos/editor-support/spine-wasm/spine-wasm.cpp @@ -43,14 +43,16 @@ namespace { auto* regionAttachment = static_cast(attachment); attachmentVertices = static_cast(regionAttachment->getRendererObject()); } - auto& textureName = attachmentVertices->_textureId; - if (textureMap.containsKey(textureName)) { - attachmentVertices->_textureId = textureMap[textureName]; - } else { - spine::String logInfo(attachment->getName()); - logInfo.append(" attachment's texture doesn`t exist "); - logInfo.append(textureName); - logToConsole(logInfo.buffer()); + if (attachmentVertices) { + auto& textureName = attachmentVertices->_textureId; + if (textureMap.containsKey(textureName)) { + attachmentVertices->_textureId = textureMap[textureName]; + } else { + spine::String logInfo(attachment->getName()); + logInfo.append(" attachment's texture doesn`t exist "); + logInfo.append(textureName); + logToConsole(logInfo.buffer()); + } } } }