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