From e5f38e34e9ca87ad049ffb6060db2157c03234da Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 14 Oct 2016 15:14:56 -0500 Subject: [PATCH] Fixes cannot read property of undefined if there is no local video. --- conference.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/conference.js b/conference.js index 55818c015..9f892d642 100644 --- a/conference.js +++ b/conference.js @@ -1302,12 +1302,14 @@ export default { } room.on(ConferenceEvents.CONNECTION_STATS, function (stats) { + // if we say video muted we will use old method of calculating + // quality and will not depend on localVideo if it is missing ConnectionQuality.updateLocalStats( stats, connectionIsInterrupted, - localVideo.videoType, - localVideo.isMuted(), - localVideo.resolution); + localVideo ? localVideo.videoType : undefined, + localVideo ? localVideo.isMuted() : true, + localVideo ? localVideo.resolution : null); }); ConnectionQuality.addListener(CQEvents.LOCALSTATS_UPDATED,