mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Fix addDelegate crash in Avatar class (Check if presenceModel is not nil)
This commit is contained in:
parent
2e0fd1f898
commit
989471fca2
1 changed files with 3 additions and 1 deletions
|
|
@ -152,7 +152,9 @@ class Avatar : UIView {
|
|||
onPresenceReceived: { (linphoneFriend: Friend) -> Void in
|
||||
if (linphoneFriend.address?.asStringUriOnly()) != nil {
|
||||
let presenceModel = linphoneFriend.getPresenceModelForUriOrTel(uriOrTel: (linphoneFriend.address?.asStringUriOnly())!)
|
||||
NotificationCenter.default.post(name: Notification.Name("LinphoneFriendPresenceUpdate"), object: nil, userInfo: ["friend": linphoneFriend.address?.asStringUriOnly() ?? "", "isOnline": presenceModel!.consolidatedPresence.rawValue == LinphoneConsolidatedPresenceOnline.rawValue])
|
||||
if(presenceModel != nil && presenceModel?.consolidatedPresence != nil){
|
||||
NotificationCenter.default.post(name: Notification.Name("LinphoneFriendPresenceUpdate"), object: nil, userInfo: ["friend": linphoneFriend.address?.asStringUriOnly() ?? "", "isOnline": presenceModel!.consolidatedPresence.rawValue == LinphoneConsolidatedPresenceOnline.rawValue])
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue