From 0bb6e0b11cf2fda4ecdb89a6407d919c6ed328f5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 12 Oct 2016 12:18:18 +0200 Subject: Remove superfluous context null checks. Code MUST pass a non-null context to all functions. Checking ctx for null and failing silently is no more useful than segfaulting. fz_keep_imp and fz_drop_imp handle NULL pointers safely, so the NULL checks for this can also be dropped at the same time. --- platform/android/viewer/jni/mupdf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/android/viewer/jni/mupdf.c') diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c index 9f26651b..e928e70f 100644 --- a/platform/android/viewer/jni/mupdf.c +++ b/platform/android/viewer/jni/mupdf.c @@ -2341,7 +2341,7 @@ JNI_FN(MuPDFCore_getFocusedWidgetTypeInternal)(JNIEnv * env, jobject thiz) pdf_document *idoc = pdf_specifics(ctx, glo->doc); pdf_widget *focus; - if (ctx, idoc == NULL) + if (ctx == NULL || idoc == NULL) return NONE; focus = pdf_focused_widget(ctx, idoc); @@ -2376,7 +2376,7 @@ JNI_FN(MuPDFCore_getFocusedWidgetSignatureState)(JNIEnv * env, jobject thiz) pdf_document *idoc = pdf_specifics(ctx, glo->doc); pdf_widget *focus; - if (ctx, idoc == NULL) + if (ctx == NULL || idoc == NULL) return Signature_NoSupport; focus = pdf_focused_widget(ctx, idoc); -- cgit v1.2.3