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]);
|
this.ee.emitEvent('streamDestroyed', [streamEvent]);
|
||||||
streamEvent.callDefaultBehavior();
|
streamEvent.callDefaultBehavior();
|
||||||
|
|
||||||
// Deleting the remote stream
|
// Deleting the remote stream if it exists
|
||||||
const streamId: string = connection.stream!.streamId;
|
if (connection.stream != null) {
|
||||||
this.remoteStreamsCreated.delete(streamId);
|
const streamId: string = connection.stream!.streamId;
|
||||||
|
this.remoteStreamsCreated.delete(streamId);
|
||||||
connection.removeStream(streamId);
|
connection.removeStream(streamId);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((openViduError) => {
|
.catch((openViduError) => {
|
||||||
logger.error(openViduError);
|
logger.error(openViduError);
|
||||||
|
|
Loading…
Reference in New Issue