]> sjero.net Git - linphone/commitdiff
fix LinphoneAddress.setDisplay with null value
authorJehan Monnier <jehan.monnier@linphone.org>
Fri, 25 Jun 2010 09:22:45 +0000 (11:22 +0200)
committerJehan Monnier <jehan.monnier@linphone.org>
Fri, 25 Jun 2010 09:22:45 +0000 (11:22 +0200)
coreapi/linphonecore_jni.cc

index 6d868675aa83ed28f93fe0fd14ff73d9a5e0152f..7501e25ab8a87ad9bf305469dfc7731824385e74 100644 (file)
@@ -562,9 +562,9 @@ extern "C" void Java_org_linphone_core_LinphoneAddressImpl_setDisplayName(JNIEnv
                                                                                                                                                ,jobject  thiz
                                                                                                                                                ,jlong address
                                                                                                                                                ,jstring jdisplayName) {
-       const char* displayName = env->GetStringUTFChars(jdisplayName, NULL);
+       const char* displayName = jdisplayName!= NULL?env->GetStringUTFChars(jdisplayName, NULL):NULL;
        linphone_address_set_display_name((LinphoneAddress*)address,displayName);
-       env->ReleaseStringUTFChars(jdisplayName, displayName);
+       if (displayName != NULL) env->ReleaseStringUTFChars(jdisplayName, displayName);
 }