From 405fca84dad4bb361b947c60dd513c9eb642fc3f Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 16 Dec 2024 09:06:47 +0800 Subject: [PATCH] [v3.8.5] Fix constructing spine::String with null pointer. (#18038) It's a bug from v3.8.5-beta0. --- native/cocos/editor-support/spine/SpineString.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/native/cocos/editor-support/spine/SpineString.cpp b/native/cocos/editor-support/spine/SpineString.cpp index c86cfc439f2..617bbc10f6c 100644 --- a/native/cocos/editor-support/spine/SpineString.cpp +++ b/native/cocos/editor-support/spine/SpineString.cpp @@ -55,7 +55,8 @@ String::String(const char *chars, size_t len, bool own) { } } -String::String(const char *chars, bool own/* = false*/): String(chars, strlen(chars), own) { +String::String(const char *chars, bool own/* = false*/) + : String(chars, (chars ? strlen(chars) : 0), own) { } String::String(const String &other) {