Reputation: 546
I am developing a group call application, after I receive ice I have the following problem:
Thread 1: EXC_BAD_ACCESS (code=1, address=0x40)
Is there any way to solve this? [] [enter image description here]4
Upvotes: 0
Views: 51
Reputation: 28892
It seems that either participantJoineds
has no element at the first index, or .remotePeer
is nil.
You should change the line to:
if participantJoindeds.first?.remotePeer?.remoteDescription != nil {
or even better:
if let description = participantJoindeds.first?.remotePeer?.remoteDescription {
If the method should end after this statement has been evaluated, you could also do:
guard let description = participantJoindeds.first?.remotePeer?.remoteDescription else {
participantJoindeds.first?.arrIceCandidate?.append(iceCandidate)
return
}
Upvotes: 2