Commit 66715b35 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed crash if friend doesn't have a core yet while creating a vcard

parent 86de4723
......@@ -1068,6 +1068,8 @@ void linphone_friend_set_vcard(LinphoneFriend *fr, LinphoneVcard *vcard) {
bool_t linphone_friend_create_vcard(LinphoneFriend *fr, const char *name) {
LinphoneVcard *vcard = NULL;
LinphoneCore *lc = NULL;
bool_t skip = FALSE;
if (!fr || !name) {
ms_error("Friend or name is null");
......@@ -1083,8 +1085,15 @@ bool_t linphone_friend_create_vcard(LinphoneFriend *fr, const char *name) {
}
vcard = linphone_vcard_new();
bool_t skip = 1 - lp_config_get_int(fr->lc->config, "misc", "store_friends", 1);
linphone_vcard_set_skip_validation(vcard, skip);
lc = fr->lc;
if (!lc && fr->friend_list) {
lc = fr->friend_list->lc;
}
if (lc) {
skip = 1 - lp_config_get_int(fr->lc->config, "misc", "store_friends", 1);
linphone_vcard_set_skip_validation(vcard, skip);
}
linphone_vcard_set_full_name(vcard, name);
linphone_friend_set_vcard(fr, vcard);
return TRUE;
......
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