From 3aedce11f2d2c5ce0a4c114360f2ca08313f22ea Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Mon, 18 Dec 2017 22:27:57 -0800 Subject: [PATCH] fix(filmstrip): prevent error on updating indicators for shared video Shared video (youtube videos) do not have indicator icons about dominant speaker and raised hand. Add a check to see if the indicator icon container exists before trying to attach react icons to it. The error thrown didn't seem to be causing any UI issues though. While this truthy check before doing ReactDOM.render seems like it should be a general practice, I'm hesistatnt to make the change broadly because it hasn't been a problem so far. --- modules/UI/videolayout/SmallVideo.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index 2211cb18d..bf005fc9b 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -776,6 +776,10 @@ SmallVideo.prototype.updateIndicators = function() { const indicatorToolbar = this.container.querySelector('.videocontainer__toptoolbar'); + if (!indicatorToolbar) { + return; + } + const iconSize = UIUtil.getIndicatorFontSize(); const showConnectionIndicator = this.videoIsHovered || !interfaceConfig.CONNECTION_INDICATOR_AUTO_HIDE_ENABLED;