mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: protect onParticipantUnpublished upon undefined Connection.stream
parent
1ece085349
commit
cc8ac8d99d
|
@ -904,11 +904,12 @@ export class Session extends EventDispatcher {
|
|||
this.ee.emitEvent('streamDestroyed', [streamEvent]);
|
||||
streamEvent.callDefaultBehavior();
|
||||
|
||||
// Deleting the remote stream
|
||||
const streamId: string = connection.stream!.streamId;
|
||||
this.remoteStreamsCreated.delete(streamId);
|
||||
|
||||
connection.removeStream(streamId);
|
||||
// Deleting the remote stream if it exists
|
||||
if (connection.stream != null) {
|
||||
const streamId: string = connection.stream!.streamId;
|
||||
this.remoteStreamsCreated.delete(streamId);
|
||||
connection.removeStream(streamId);
|
||||
}
|
||||
})
|
||||
.catch((openViduError) => {
|
||||
logger.error(openViduError);
|
||||
|
|
Loading…
Reference in New Issue