From 57a9c7533c839b0cc31e8d85a7f0b28e32d48de0 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sun, 15 Dec 2024 14:20:26 +0800 Subject: [PATCH] [v3.8.5] Fix constructing spine::String with null pointer. 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) {