From 683c91bbfac7159deb16e396d41b8f15da9a9bbb Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 16 May 2012 14:17:37 +0800 Subject: [PATCH] fixed #1236: return empty string when parameter is null --- cocos2dx/platform/android/jni/JniHelper.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos2dx/platform/android/jni/JniHelper.cpp b/cocos2dx/platform/android/jni/JniHelper.cpp index 8d5e6cdc07..a4e6db6e4d 100644 --- a/cocos2dx/platform/android/jni/JniHelper.cpp +++ b/cocos2dx/platform/android/jni/JniHelper.cpp @@ -159,6 +159,11 @@ extern "C" static string jstring2string_(jstring jstr) { + if (jstr == NULL) + { + return ""; + } + JNIEnv *env = 0; if (! getEnv(&env))