From c047fa514ab30a604bd17449afa02279f661658d Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 1 Jun 2016 19:51:20 +0200 Subject: [PATCH] handle the case where the value returned by linphone_proxy_config_get_custom_header() is NULL --- coreapi/linphonecore_jni.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 3feeda4eb..0c5a6fcfc 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -4707,9 +4707,9 @@ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_setCustomH JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_getCustomHeader(JNIEnv *env, jobject thiz, jlong ptr, jstring jname) { const char *name = jname ? env->GetStringUTFChars(jname, NULL) : NULL; - jstring jvalue = env->NewStringUTF(linphone_proxy_config_get_custom_header((LinphoneProxyConfig *)ptr, name)); + const char *value = linphone_proxy_config_get_custom_header((LinphoneProxyConfig *)ptr, name); if (jname) env->ReleaseStringUTFChars(jname, name); - return jvalue; + return value ? env->NewStringUTF(value) : NULL; }