Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

handle missing remoteVideo when removing video element

isymchychf242c8cfdc25
diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js
index b7f20e1e21..04653aa3b3 100644
--- a/modules/UI/videolayout/VideoLayout.js
+++ b/modules/UI/videolayout/VideoLayout.js
@@ -271,7 +271,10 @@ var VideoLayout = {
onRemoteStreamRemoved (stream) {
let id = stream.getParticipantId();
- remoteVideos[id].removeRemoteStreamElement(stream);
+ let remoteVideo = remoteVideos[id];
+ if (remoteVideo) { // remote stream may be removed after participant left the conference
+ remoteVideo.removeRemoteStreamElement(stream);
+ }
},
/**