diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-16 22:40:09 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-16 23:13:41 +0800 |
commit | c9e3eb6f03a07f663c7cd1f82e683bdd96c8bdea (patch) | |
tree | ff26ffa59c8ab9e922990361daa843300cba79e3 /platform | |
parent | 3dc9cfd2af0e795703c4fed6b105153e85501ce7 (diff) | |
download | mupdf-c9e3eb6f03a07f663c7cd1f82e683bdd96c8bdea.tar.xz |
JNI: Check if get_context has thrown exception,
But do not check it twice.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/java/mupdf_native.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index d77f101b..84743e26 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -4992,6 +4992,7 @@ FUN(DocumentWriter_newNativeDocumentWriter)(JNIEnv *env, jobject self, jstring j const char *format = NULL; const char *options = NULL; + if (!ctx) return 0; if (!jfilename) { jni_throw_arg(env, "filename must not be null"); return 0; } filename = (*env)->GetStringUTFChars(env, jfilename, NULL); @@ -5728,6 +5729,7 @@ FUN(PDFDocument_graftObject)(JNIEnv *env, jobject self, jobject jsrc, jobject jo pdf_obj *obj = from_PDFObject(env, jobj); pdf_graft_map *map = from_PDFGraftMap(env, jmap); + if (!ctx) return NULL; if (!src) { jni_throw_arg(env, "source must not be null"); return NULL; } fz_try(ctx) @@ -6886,7 +6888,6 @@ FUN(PDFObject_putDictionaryPDFObjectInteger)(JNIEnv *env, jobject self, jobject pdf_obj *val = NULL; if (!ctx) return; - if (!ctx) return; fz_try(ctx) { @@ -6909,7 +6910,6 @@ FUN(PDFObject_putDictionaryPDFObjectFloat)(JNIEnv *env, jobject self, jobject jn pdf_obj *val = NULL; if (!ctx) return; - if (!ctx) return; fz_try(ctx) { |