Commit b59170b7 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

Java/Exception: simplify RethrowException()

parent a237db55
......@@ -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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment