From cf109f97873f745f361f9bdd803d41e6be82d736 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Fri, 31 Jan 2025 14:11:31 +0100 Subject: [PATCH] Allow participantDevice to be nullable in onActiveSpeakerParticipantDevice callback --- Linphone/UI/Call/ViewModel/CallViewModel.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Linphone/UI/Call/ViewModel/CallViewModel.swift b/Linphone/UI/Call/ViewModel/CallViewModel.swift index 728515d2b..12562219b 100644 --- a/Linphone/UI/Call/ViewModel/CallViewModel.swift +++ b/Linphone/UI/Call/ViewModel/CallViewModel.swift @@ -580,15 +580,15 @@ class CallViewModel: ObservableObject { } } }) - }, onActiveSpeakerParticipantDevice: { (conference: Conference, participantDevice: ParticipantDevice) in - if participantDevice.address != nil { + }, onActiveSpeakerParticipantDevice: { (conference: Conference, participantDevice: ParticipantDevice?) in + if participantDevice != nil && participantDevice!.address != nil { let activeSpeakerParticipantBis = self.activeSpeakerParticipant let activeSpeakerParticipantTmp = ParticipantModel( - address: participantDevice.address!, + address: participantDevice!.address!, isJoining: false, - onPause: participantDevice.state == .OnHold, - isMuted: participantDevice.isMuted + onPause: participantDevice!.state == .OnHold, + isMuted: participantDevice!.isMuted ) var activeSpeakerNameTmp = ""