summaryrefslogtreecommitdiff
path: root/platform/java
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-07-19 03:27:08 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-07-19 03:31:17 +0800
commit023c272cf4b605a8dc96d02100988f385fd98cb4 (patch)
treed110c0dcd6ada4312aca0ca904a84788a89609b3 /platform/java
parentde0346599c01866ef45e7e984232d1079352ef88 (diff)
downloadmupdf-023c272cf4b605a8dc96d02100988f385fd98cb4.tar.xz
JNI: Fix bug in Document.loadOutline.
Previously an exception was thrown for documents without an outline. Now document both with and without an outline are handled correctly.
Diffstat (limited to 'platform/java')
-rw-r--r--platform/java/mupdf_native.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index 7e8fa66f..fd53b019 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -3863,14 +3863,18 @@ FUN(Document_loadOutline)(JNIEnv *env, jobject self)
fz_try(ctx)
outline = fz_load_outline(ctx, doc);
fz_catch(ctx)
+ {
jni_rethrow(env, ctx);
+ return NULL;
+ }
- joutline = to_Outline_safe(ctx, env, outline);
- if (joutline == NULL)
+ if (outline != NULL)
{
- jni_throw(env, FZ_ERROR_GENERIC, "loadOutline failed");
+ joutline = to_Outline_safe(ctx, env, outline);
+ if (joutline == NULL)
+ jni_throw(env, FZ_ERROR_GENERIC, "loadOutline failed");
+ fz_drop_outline(ctx, outline);
}
- fz_drop_outline(ctx, outline);
return joutline;
}