diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-15 14:03:55 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-15 14:07:48 +0800 |
commit | c04373e6d50b20f7475049fbd5724b5ecd73fa30 (patch) | |
tree | 1335d8281d8fa44c0bbf918f98b8d756c96b15b1 /platform | |
parent | e21a1dc662e3d8fde14a3bfa30cb1b9d8badbdc0 (diff) | |
download | mupdf-c04373e6d50b20f7475049fbd5724b5ecd73fa30.tar.xz |
JNI: Catch fitz exceptions and convert to Java exceptions.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/java/mupdf_native.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index 4aec3124..130749a9 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -4062,9 +4062,13 @@ FUN(Page_countSeparations)(JNIEnv *env, jobject self) if (!ctx) return 0; - nSep = fz_count_separations_on_page(ctx, page); - - LOGI("Page_countSeparations %d", nSep); + fz_try(ctx) + nSep = fz_count_separations_on_page(ctx, page); + fz_catch(ctx) + { + jni_rethrow(env, ctx); + return 0; + } return nSep; } @@ -4077,7 +4081,10 @@ FUN(Page_enableSeparation)(JNIEnv *env, jobject self, int sep, jboolean enable) if (!ctx) return; - fz_control_separation_on_page(ctx, page, sep, !enable); + fz_try(ctx) + fz_control_separation_on_page(ctx, page, sep, !enable); + fz_catch(ctx) + jni_rethrow(env, ctx); } JNIEXPORT jobject JNICALL |