diff --git a/Linphone/Contacts/ContactsManager.swift b/Linphone/Contacts/ContactsManager.swift index c624f58a1..5e8efdf50 100644 --- a/Linphone/Contacts/ContactsManager.swift +++ b/Linphone/Contacts/ContactsManager.swift @@ -312,10 +312,10 @@ final class ContactsManager: ObservableObject { clonedAddress!.clean() let sipUri = clonedAddress!.asStringUriOnly() - if self.friendList != nil { + if self.friendList != nil && !self.friendList!.friends.isEmpty { var friend: Friend? friend = self.friendList!.friends.first(where: {$0.addresses.contains(where: {$0.asStringUriOnly() == sipUri})}) - if friend == nil { + if friend == nil && self.linphoneFriendList != nil && !self.linphoneFriendList!.friends.isEmpty { friend = self.linphoneFriendList!.friends.first(where: {$0.addresses.contains(where: {$0.asStringUriOnly() == sipUri})}) }