Added error checking to NewStringNative

This commit is contained in:
Elias Naur 2007-03-09 14:28:52 +00:00
parent 9f147c754a
commit eeb711239e
1 changed files with 4 additions and 0 deletions

View File

@ -210,7 +210,11 @@ jstring NewStringNative(JNIEnv *env, const char *str) {
}
jcls_str = (*env)->FindClass(env,"java/lang/String");
if (jcls_str == NULL)
return NULL;
jmethod_str = (*env)->GetMethodID(env,jcls_str, "<init>", "([B)V");
if (jmethod_str == NULL)
return NULL;
bytes = 0;