mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 06:38:08 +00:00
Allow null strings in LpConfig.getString
This commit is contained in:
parent
470227cf85
commit
13442d397b
1 changed files with 12 additions and 4 deletions
|
|
@ -3122,13 +3122,21 @@ extern "C" void Java_org_linphone_core_LpConfigImpl_setString(JNIEnv *env, jobje
|
|||
|
||||
extern "C" jstring Java_org_linphone_core_LpConfigImpl_getString(JNIEnv *env, jobject thiz, jlong lpc,
|
||||
jstring section, jstring key, jstring defaultValue) {
|
||||
const char *csection = env->GetStringUTFChars(section, NULL);
|
||||
const char *csection = env->GetStringUTFChars(section, NULL);
|
||||
const char *ckey = env->GetStringUTFChars(key, NULL);
|
||||
const char *cvalue = env->GetStringUTFChars(defaultValue, NULL);
|
||||
const char *returnValue = lp_config_get_string((LpConfig *)lpc, csection, ckey, cvalue);
|
||||
const char *cvalue;
|
||||
if (defaultValue == NULL) {
|
||||
cvalue = NULL;
|
||||
} else {
|
||||
cvalue = env->GetStringUTFChars(defaultValue, NULL);
|
||||
}
|
||||
|
||||
const char *returnValue = lp_config_get_string((LpConfig *)lpc, csection, ckey, cvalue);
|
||||
|
||||
env->ReleaseStringUTFChars(section, csection);
|
||||
env->ReleaseStringUTFChars(key, ckey);
|
||||
env->ReleaseStringUTFChars(defaultValue, cvalue);
|
||||
if (cvalue)
|
||||
env->ReleaseStringUTFChars(defaultValue, cvalue);
|
||||
return returnValue ? env->NewStringUTF(returnValue) : NULL;
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LpConfigImpl_setIntRange(JNIEnv *env, jobject thiz, jlong lpc,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue