From 8aeacd935c005be27c3c34aa9e8cc616ec5e6ddd 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 (cherry picked from commit b09dbaa78e716078806fdf1f88dea279d7d3c257) --- 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 371cc77e54a..a6e50c12328 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);