From e21a1dc662e3d8fde14a3bfa30cb1b9d8badbdc0 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Thu, 15 Sep 2016 14:00:56 +0800 Subject: JNI: Don't replace Java exception with one from fitz. The JNI interface throws exceptions of its own, keep those instead of replacing them. --- platform/java/mupdf_native.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'platform/java') diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index d886ef19..4aec3124 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -3732,26 +3732,21 @@ FUN(Document_proofNative)(JNIEnv *env, jobject self, jstring jCurrentPath, jstri if (!jDisplayProfile) { jni_throw_arg(env, "displayProfile must not be null"); return NULL; } currentPath = (*env)->GetStringUTFChars(env, jCurrentPath, NULL); - if (currentPath == NULL) - { - jni_throw(env, FZ_ERROR_GENERIC, "Document_proofNative failed"); + if (!currentPath) return NULL; - } printProfile = (*env)->GetStringUTFChars(env, jPrintProfile, NULL); - if (printProfile == NULL) + if (!printProfile) { - jni_throw(env, FZ_ERROR_GENERIC, "Document_proofNative failed"); (*env)->ReleaseStringUTFChars(env, jCurrentPath, currentPath); return NULL; } displayProfile = (*env)->GetStringUTFChars(env, jDisplayProfile, NULL); - if (displayProfile == NULL) + if (!displayProfile) { (*env)->ReleaseStringUTFChars(env, jCurrentPath, currentPath); (*env)->ReleaseStringUTFChars(env, jPrintProfile, printProfile); - jni_throw(env, FZ_ERROR_GENERIC, "Document_proofNative failed"); return NULL; } -- cgit v1.2.3