diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-10-12 12:18:18 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-10-12 14:45:42 +0200 |
commit | 0bb6e0b11cf2fda4ecdb89a6407d919c6ed328f5 (patch) | |
tree | 9eda479951c3dbe2ee0cd2ea9417e3a4a829044d /platform | |
parent | ca8d9898719671627231c9d909cfd9ba252ab4a2 (diff) | |
download | mupdf-0bb6e0b11cf2fda4ecdb89a6407d919c6ed328f5.tar.xz |
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.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/viewer/jni/mupdf.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |