Skip to content

Commit

Permalink
Fix exceptions in events (#30)
Browse files Browse the repository at this point in the history
* Fix to use Participant's Sid

* Fix to use TrackUnsubscribed
  • Loading branch information
sus-yoshikane-t authored Apr 18, 2024
1 parent 005674c commit b4911c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Runtime/Scripts/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b4911c5

Please sign in to comment.