From eeebd4aa4f5dc246ee2e4ec602e2d7e7d68b5a6b Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 20 Jan 2017 11:10:42 +0100 Subject: [PATCH] Do not try to erase friend from map if ref key is null --- coreapi/friendlist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index 7acf390d3..ee3de52e0 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -585,8 +585,10 @@ static LinphoneFriendListStatus _linphone_friend_list_remove_friend(LinphoneFrie lf->friend_list = NULL; linphone_friend_unref(lf); list->friends = bctbx_list_erase_link(list->friends, elem); - bctbx_iterator_t * it = bctbx_map_cchar_find_key(list->friends_map, lf->refkey); - bctbx_map_cchar_erase(list->friends_map, it); + if(lf->refkey) { + bctbx_iterator_t * it = bctbx_map_cchar_find_key(list->friends_map, lf->refkey); + bctbx_map_cchar_erase(list->friends_map, it); + } return LinphoneFriendListOK; }