Commit f7f858cb authored by Max Kellermann's avatar Max Kellermann

android/Context: use DiscardException()

parent 4d1546cb
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "Context.hxx" #include "Context.hxx"
#include "java/Class.hxx" #include "java/Class.hxx"
#include "java/Exception.hxx"
#include "java/File.hxx" #include "java/File.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
...@@ -33,10 +34,8 @@ Context::GetCacheDir(JNIEnv *env) const ...@@ -33,10 +34,8 @@ Context::GetCacheDir(JNIEnv *env) const
assert(method); assert(method);
jobject file = env->CallObjectMethod(Get(), method); jobject file = env->CallObjectMethod(Get(), method);
if (file == nullptr) { if (Java::DiscardException(env) || file == nullptr)
env->ExceptionClear();
return nullptr; return nullptr;
}
return Java::File::ToAbsolutePath(env, file); return Java::File::ToAbsolutePath(env, file);
} }
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