Merge pull request #5552 from volzhs/fix-jni-null
Fix crash when null value through jni on android
This commit is contained in:
commit
90b5b0d1c9
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue