From b09dbaa78e716078806fdf1f88dea279d7d3c257 Mon Sep 17 00:00:00 2001 From: volzhs Date: Tue, 5 Jul 2016 04:41:46 +0900 Subject: [PATCH] Fix crash when null value through jni on android --- platform/android/java_glue.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 3ea2ab16413..45d02876bab 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -238,6 +238,10 @@ String _get_class_name(JNIEnv * env, jclass cls, bool* array) { Variant _jobject_to_variant(JNIEnv * env, jobject obj) { + if (obj == NULL) { + return Variant(); + } + jclass c = env->GetObjectClass(obj); bool array; String name = _get_class_name(env, c, &array);