mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Do not crash if friend whith no LC but show an error
This commit is contained in:
parent
717ea1ee62
commit
de7a430668
2 changed files with 6 additions and 2 deletions
|
|
@ -108,13 +108,16 @@ static int friend_compare(const void * a, const void * b) {
|
|||
}
|
||||
|
||||
static LinphoneFriendPresence * find_presence_model_for_uri_or_tel(const LinphoneFriend *lf, const char *uri_or_tel) {
|
||||
bctbx_list_t *iterator = lf->presence_models;
|
||||
LinphoneAddress *uri_or_tel_addr = linphone_core_interpret_url(lf->lc, uri_or_tel);
|
||||
bctbx_list_t *iterator = NULL;
|
||||
LinphoneAddress *uri_or_tel_addr = NULL;
|
||||
LinphoneFriendPresence *result=NULL;
|
||||
if (!lf->lc) {
|
||||
ms_warning("Cannot find uri of tel [%s] from friend [%p] because not associated to any Linphone core object",uri_or_tel,lf);
|
||||
return NULL;
|
||||
}
|
||||
iterator = lf->presence_models;
|
||||
uri_or_tel_addr = linphone_core_interpret_url(lf->lc, uri_or_tel);
|
||||
|
||||
while (uri_or_tel_addr && iterator) {
|
||||
LinphoneFriendPresence *lfp = (LinphoneFriendPresence *)bctbx_list_get_data(iterator);
|
||||
LinphoneAddress *lfp_addr = linphone_core_interpret_url(lf->lc, lfp->uri_or_tel);
|
||||
|
|
|
|||
|
|
@ -706,6 +706,7 @@ LinphoneFriend * linphone_friend_list_find_friend_by_uri(const LinphoneFriendLis
|
|||
LinphoneFriend * linphone_friend_list_find_friend_by_ref_key(const LinphoneFriendList *list, const char *ref_key) {
|
||||
const bctbx_list_t *elem;
|
||||
if (ref_key == NULL) return NULL;
|
||||
if (list == NULL) return NULL;
|
||||
for (elem = list->friends; elem != NULL; elem = bctbx_list_next(elem)) {
|
||||
LinphoneFriend *lf = (LinphoneFriend *)bctbx_list_get_data(elem);
|
||||
if ((lf->refkey != NULL) && (strcmp(lf->refkey, ref_key) == 0)) return lf;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue