mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Fixed crash if friend doesn't have a core yet while creating a vcard
This commit is contained in:
parent
86de4723da
commit
66715b35bc
1 changed files with 11 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue