Commit b1a30f1a authored by Benjamin REIS's avatar Benjamin REIS
Browse files

Fix crash when no default friend_list

parent a0d1ddf8
......@@ -773,10 +773,12 @@ 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) {
bctbx_iterator_t* it = bctbx_map_cchar_find_key(list->friends_map, (void*)ref_key);
if (!bctbx_iterator_cchar_equals(it, bctbx_map_cchar_end(list->friends_map))) {
bctbx_pair_t *pair = bctbx_iterator_cchar_get_pair(it);
return (LinphoneFriend *)bctbx_pair_cchar_get_second(pair);
if(list) {
bctbx_iterator_t* it = bctbx_map_cchar_find_key(list->friends_map, (void*)ref_key);
if (!bctbx_iterator_cchar_equals(it, bctbx_map_cchar_end(list->friends_map))) {
bctbx_pair_t *pair = bctbx_iterator_cchar_get_pair(it);
return (LinphoneFriend *)bctbx_pair_cchar_get_second(pair);
}
}
return 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