diff options
Diffstat (limited to 'platform/java/mupdf_native.c')
-rw-r--r-- | platform/java/mupdf_native.c | 12 |
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; } |