Commit eea67458 authored by Yoann HOUPERT's avatar Yoann HOUPERT
Browse files

add check participant value

parent be245bf5
Pipeline #3717 passed with stage
in 48 seconds
...@@ -24,16 +24,18 @@ robotController = { ...@@ -24,16 +24,18 @@ robotController = {
getRemoteParticipants: () => { getRemoteParticipants: () => {
const participants = easyrtc.getRoomOccupantsAsArray(room); const participants = easyrtc.getRoomOccupantsAsArray(room);
const res = []; const res = [];
for (let i = 0; i < participants.length; i++) { if (participants) {
const participant = participants[i]; for (let i = 0; i < participants.length; i++) {
try { const participant = participants[i];
const mediaStream = robotController.getRemoteStream(participant); try {
if (mediaStream !== null) { const mediaStream = robotController.getRemoteStream(participant);
res.push(participant); if (mediaStream !== null) {
res.push(participant);
}
} catch (err) {
console.error('could not get remote stream for %s', participant);
console.error(err);
} }
} catch (err) {
console.error('could not get remote stream for %s', participant);
console.error(err);
} }
} }
return res; return res;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment