Browse Source

Improves safe checks for missing stats.

master
damencho 8 years ago
parent
commit
39a8681e8e
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      modules/UI/videolayout/ConnectionIndicator.js

+ 4
- 4
modules/UI/videolayout/ConnectionIndicator.js View File

64
 ConnectionIndicator.prototype.generateText = function () {
64
 ConnectionIndicator.prototype.generateText = function () {
65
     var downloadBitrate, uploadBitrate, packetLoss, i;
65
     var downloadBitrate, uploadBitrate, packetLoss, i;
66
 
66
 
67
-    if(this.bitrate === null) {
67
+    if(!this.bitrate) {
68
         downloadBitrate = "N/A";
68
         downloadBitrate = "N/A";
69
         uploadBitrate = "N/A";
69
         uploadBitrate = "N/A";
70
     }
70
     }
75
             this.bitrate.upload? this.bitrate.upload + " Kbps" : "N/A";
75
             this.bitrate.upload? this.bitrate.upload + " Kbps" : "N/A";
76
     }
76
     }
77
 
77
 
78
-    if(this.packetLoss === null) {
78
+    if(!this.packetLoss) {
79
         packetLoss = "N/A";
79
         packetLoss = "N/A";
80
     } else {
80
     } else {
81
 
81
 
132
 
132
 
133
     if (this.showMoreValue) {
133
     if (this.showMoreValue) {
134
         var downloadBandwidth, uploadBandwidth, transport;
134
         var downloadBandwidth, uploadBandwidth, transport;
135
-        if (this.bandwidth === null) {
135
+        if (!this.bandwidth) {
136
             downloadBandwidth = "N/A";
136
             downloadBandwidth = "N/A";
137
             uploadBandwidth = "N/A";
137
             uploadBandwidth = "N/A";
138
         } else {
138
         } else {
341
  */
341
  */
342
 ConnectionIndicator.prototype.updateConnectionQuality =
342
 ConnectionIndicator.prototype.updateConnectionQuality =
343
     function (percent, object) {
343
     function (percent, object) {
344
-    if (percent === null) {
344
+    if (!percent) {
345
         this.connectionIndicatorContainer.style.display = "none";
345
         this.connectionIndicatorContainer.style.display = "none";
346
         this.popover.forceHide();
346
         this.popover.forceHide();
347
         return;
347
         return;

Loading…
Cancel
Save