java/File: use DiscardException()
This commit is contained in:
parent
a4bc972aad
commit
4d1546cb38
@ -31,6 +31,7 @@
|
||||
#include "Class.hxx"
|
||||
#include "String.hxx"
|
||||
#include "Object.hxx"
|
||||
#include "Exception.hxx"
|
||||
#include "fs/AllocatedPath.hxx"
|
||||
#include "fs/Limits.hxx"
|
||||
|
||||
@ -54,10 +55,8 @@ Java::File::ToAbsolutePath(JNIEnv *env, jobject _file) noexcept
|
||||
LocalObject file(env, _file);
|
||||
|
||||
const jstring path = getAbsolutePath(env, file);
|
||||
if (path == nullptr) {
|
||||
env->ExceptionClear();
|
||||
if (DiscardException(env) || path == nullptr)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Java::String path2(env, path);
|
||||
return AllocatedPath::FromFS(path2.ToString());
|
||||
|
Loading…
Reference in New Issue
Block a user