From a93ded21d0c2cc91a93985aa8f894d50d7d209d2 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Tue, 10 Mar 2020 23:24:20 +1030 Subject: [PATCH] Don't start jni server if a startup exception is thrown --- jni_server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jni_server.c b/jni_server.c index 05d8da4f..3f323b7c 100644 --- a/jni_server.c +++ b/jni_server.c @@ -142,6 +142,10 @@ JNIEXPORT jint JNICALL Java_org_servalproject_servaldna_ServalDCommand_server( jstring str = (jstring)(*env)->NewStringUTF(env, instance_path()); (*env)->CallVoidMethod(env, callback, started, str, getpid(), mdp_loopback_port, httpd_server_port); (*env)->DeleteLocalRef(env, str); + if ((*env)->ExceptionCheck(env)){ + ret = WHY("Not starting server due to startup exception"); + goto end; + } } server_loop(waiting, wokeup);