Fix crash when null value through jni on android

(cherry picked from commit b09dbaa78e)
This commit is contained in:
volzhs 2016-07-05 04:41:46 +09:00 committed by Rémi Verschelde
parent f9b7baa546
commit 8aeacd935c
1 changed files with 4 additions and 0 deletions

View File

@ -238,6 +238,10 @@ String _get_class_name(JNIEnv * env, jclass cls, bool* array) {
Variant _jobject_to_variant(JNIEnv * env, jobject obj) { Variant _jobject_to_variant(JNIEnv * env, jobject obj) {
if (obj == NULL) {
return Variant();
}
jclass c = env->GetObjectClass(obj); jclass c = env->GetObjectClass(obj);
bool array; bool array;
String name = _get_class_name(env, c, &array); String name = _get_class_name(env, c, &array);