|
@@ -551,6 +551,10 @@ JNIEnv* getJNIEnv(void)
|
|
|
state->env = getGlobalJNIEnv();
|
|
|
mutexUnlock(&jvmMutex);
|
|
|
|
|
|
+ if (!state->env) {
|
|
|
+ goto fail;
|
|
|
+ }
|
|
|
+
|
|
|
jthrowable jthr = NULL;
|
|
|
jthr = initCachedClasses(state->env);
|
|
|
if (jthr) {
|
|
@@ -558,10 +562,6 @@ JNIEnv* getJNIEnv(void)
|
|
|
"initCachedClasses failed");
|
|
|
goto fail;
|
|
|
}
|
|
|
-
|
|
|
- if (!state->env) {
|
|
|
- goto fail;
|
|
|
- }
|
|
|
return state->env;
|
|
|
|
|
|
fail:
|