mirror of https://github.com/axmolengine/axmol.git
[android] fix crash when point JNIEnv is a nullptr in getStringUTFCharsJNI func. (#19079)
This commit is contained in:
parent
aca3016bee
commit
ebc32043ea
|
@ -309,7 +309,7 @@ bool UTF32ToUTF16(const std::u32string& utf32, std::u16string& outUtf16)
|
|||
std::string getStringUTFCharsJNI(JNIEnv* env, jstring srcjStr, bool* ret)
|
||||
{
|
||||
std::string utf8Str;
|
||||
if(srcjStr != nullptr)
|
||||
if(srcjStr != nullptr && env != nullptr)
|
||||
{
|
||||
const unsigned short * unicodeChar = ( const unsigned short *)env->GetStringChars(srcjStr, nullptr);
|
||||
size_t unicodeCharLength = env->GetStringLength(srcjStr);
|
||||
|
|
Loading…
Reference in New Issue