Java/Exception: simplify RethrowException()
This commit is contained in:
parent
a237db556a
commit
b59170b702
@ -39,12 +39,10 @@ Java::Exception::Exception(JNIEnv *env, jthrowable e) noexcept
|
||||
void
|
||||
Java::RethrowException(JNIEnv *env)
|
||||
{
|
||||
jthrowable exception = env->ExceptionOccurred();
|
||||
if (exception == nullptr)
|
||||
LocalRef<jthrowable> exception{env, env->ExceptionOccurred()};
|
||||
if (!exception)
|
||||
return;
|
||||
|
||||
LocalRef<jthrowable> ref(env, exception);
|
||||
|
||||
env->ExceptionClear();
|
||||
throw Exception(env, exception);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user