diff --git a/Runtime/Scripts/Room.cs b/Runtime/Scripts/Room.cs index 134558e..4c47689 100644 --- a/Runtime/Scripts/Room.cs +++ b/Runtime/Scripts/Room.cs @@ -219,8 +219,8 @@ internal void OnEventReceived(RoomEvent e) case RoomEvent.MessageOneofCase.ParticipantDisconnected: { var sid = e.ParticipantDisconnected.ParticipantSid; - var participant = RemoteParticipants[Sid]; - _participants.Remove(Sid); + var participant = RemoteParticipants[sid]; + _participants.Remove(sid); ParticipantDisconnected?.Invoke(participant); } break; @@ -270,7 +270,7 @@ internal void OnEventReceived(RoomEvent e) break; case RoomEvent.MessageOneofCase.TrackUnsubscribed: { - var participant = RemoteParticipants[e.TrackSubscribed.ParticipantSid]; + var participant = RemoteParticipants[e.TrackUnsubscribed.ParticipantSid]; var publication = participant.Tracks[e.TrackUnsubscribed.TrackSid]; var track = publication.Track; publication.UpdateTrack(null);