Commit be38b347 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fix compilation + fix crash when vCards are disabled and URI is NULL + remove warning

parent 0a697d0d
......@@ -278,7 +278,7 @@ LinphoneAddress * linphone_friend_get_address(const LinphoneFriend *lf) {
return NULL;
}
int linphone_friend_set_address(LinphoneFriend *lf, const LinphoneAddress *addr){
int linphone_friend_set_address(LinphoneFriend *lf, const LinphoneAddress *addr) {
LinphoneAddress *fr = linphone_address_clone(addr);
linphone_address_clean(fr);
......@@ -715,7 +715,7 @@ void linphone_friend_apply(LinphoneFriend *fr, LinphoneCore *lc) {
LinphoneAddress *addr = linphone_friend_get_address(fr);
if (!addr) {
ms_warning("No sip url defined.");
ms_debug("No sip url defined in friend %s", linphone_friend_get_name(fr));
return;
}
linphone_address_unref(addr);
......@@ -1332,10 +1332,14 @@ static int create_friend(void *data, int argc, char **argv, char **colName) {
lf = linphone_friend_new_from_vcard(vcard);
}
if (!lf) {
LinphoneAddress *addr = linphone_address_new(argv[2]);
lf = linphone_friend_new();
linphone_friend_set_address(lf, addr);
linphone_address_unref(addr);
if (argv[2] != NULL) {
LinphoneAddress *addr = linphone_address_new(argv[2]);
if (addr) {
linphone_friend_set_address(lf, addr);
linphone_address_unref(addr);
}
}
}
linphone_friend_set_inc_subscribe_policy(lf, atoi(argv[3]));
linphone_friend_send_subscribe(lf, atoi(argv[4]));
......
......@@ -3864,7 +3864,7 @@ extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setPresenceModel(JNIEn
extern "C" jboolean Java_org_linphone_core_LinphoneFriendImpl_isAlreadyPresentInFriendList(JNIEnv* env, jobject thiz, jlong ptr) {
LinphoneFriend *lf = (LinphoneFriend *)ptr;
return (jboolean)lf->friend_list != NULL;
return lf->friend_list != NULL;
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment