mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3768 from michaelcontento/android-fix-null-access
[ci skip]wrong variable used which could crash the whole app
This commit is contained in:
commit
5f2c94ee3c
|
@ -254,13 +254,13 @@ namespace cocos2d {
|
|||
}
|
||||
|
||||
JNIEnv *pEnv = JniHelper::getEnv();
|
||||
if (!env) {
|
||||
if (!pEnv) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* chars = env->GetStringUTFChars(jstr, NULL);
|
||||
const char* chars = pEnv->GetStringUTFChars(jstr, NULL);
|
||||
std::string ret(chars);
|
||||
env->ReleaseStringUTFChars(jstr, chars);
|
||||
pEnv->ReleaseStringUTFChars(jstr, chars);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue