Added error checking to NewStringNative
This commit is contained in:
parent
9f147c754a
commit
eeb711239e
|
@ -210,7 +210,11 @@ jstring NewStringNative(JNIEnv *env, const char *str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
jcls_str = (*env)->FindClass(env,"java/lang/String");
|
jcls_str = (*env)->FindClass(env,"java/lang/String");
|
||||||
|
if (jcls_str == NULL)
|
||||||
|
return NULL;
|
||||||
jmethod_str = (*env)->GetMethodID(env,jcls_str, "<init>", "([B)V");
|
jmethod_str = (*env)->GetMethodID(env,jcls_str, "<init>", "([B)V");
|
||||||
|
if (jmethod_str == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue