From 39a8681e8ef6d954eddab604372ab33ab16bbb5a Mon Sep 17 00:00:00 2001 From: damencho Date: Mon, 30 Jan 2017 16:29:48 -0600 Subject: [PATCH] Improves safe checks for missing stats. --- modules/UI/videolayout/ConnectionIndicator.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/UI/videolayout/ConnectionIndicator.js b/modules/UI/videolayout/ConnectionIndicator.js index 18bff07ee..ce8021ba8 100644 --- a/modules/UI/videolayout/ConnectionIndicator.js +++ b/modules/UI/videolayout/ConnectionIndicator.js @@ -64,7 +64,7 @@ ConnectionIndicator.getStringFromArray = function (array) { ConnectionIndicator.prototype.generateText = function () { var downloadBitrate, uploadBitrate, packetLoss, i; - if(this.bitrate === null) { + if(!this.bitrate) { downloadBitrate = "N/A"; uploadBitrate = "N/A"; } @@ -75,7 +75,7 @@ ConnectionIndicator.prototype.generateText = function () { this.bitrate.upload? this.bitrate.upload + " Kbps" : "N/A"; } - if(this.packetLoss === null) { + if(!this.packetLoss) { packetLoss = "N/A"; } else { @@ -132,7 +132,7 @@ ConnectionIndicator.prototype.generateText = function () { if (this.showMoreValue) { var downloadBandwidth, uploadBandwidth, transport; - if (this.bandwidth === null) { + if (!this.bandwidth) { downloadBandwidth = "N/A"; uploadBandwidth = "N/A"; } else { @@ -341,7 +341,7 @@ ConnectionIndicator.prototype.updateConnectionStatusIndicator */ ConnectionIndicator.prototype.updateConnectionQuality = function (percent, object) { - if (percent === null) { + if (!percent) { this.connectionIndicatorContainer.style.display = "none"; this.popover.forceHide(); return;