From 446aead5a5913f5c5613b466454af195f5387b01 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Thu, 15 Sep 2016 13:59:22 +0800 Subject: JNI: Throw IllegalArgumentException for null arguments. --- platform/java/mupdf_native.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'platform') diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index 40548381..d886ef19 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -3727,8 +3727,9 @@ FUN(Document_proofNative)(JNIEnv *env, jobject self, jstring jCurrentPath, jstri const char *displayProfile = NULL; if (!ctx) return NULL; - if (jCurrentPath == NULL || jPrintProfile == NULL || jDisplayProfile == NULL) - return NULL; + if (!jCurrentPath) { jni_throw_arg(env, "currentPath must not be null"); return NULL; } + if (!jPrintProfile) { jni_throw_arg(env, "printProfile must not be null"); return NULL; } + if (!jDisplayProfile) { jni_throw_arg(env, "displayProfile must not be null"); return NULL; } currentPath = (*env)->GetStringUTFChars(env, jCurrentPath, NULL); if (currentPath == NULL) -- cgit v1.2.3