mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Fix getFriendWithAddress crash (check if friend lists are empty)
This commit is contained in:
parent
bd9e4a000f
commit
5215256f72
1 changed files with 2 additions and 2 deletions
|
|
@ -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})})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue