HDFS-14482: Crash when using libhdfs with bad classpath
This commit is contained in:
parent
7d831eca64
commit
e2dfdaee7c
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user