Browse Source

Merge pull request #418 from seanmheff/add-check-for-undefined-rtc-stat-reports

Add a check for "undefined" RTCStatsReport objects
dev1
Saúl Ibarra Corretgé 8 years ago
parent
commit
613211a2c1
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      modules/statistics/RTPStatsCollector.js

+ 5
- 0
modules/statistics/RTPStatsCollector.js View File

@@ -443,6 +443,11 @@ StatsCollector.prototype.processStatsReport = function() {
443 443
         }
444 444
         const now = this.currentStatsReport[idx];
445 445
 
446
+        // The browser API may return "undefined" values in the array
447
+        if (!now) {
448
+            continue;
449
+        }
450
+
446 451
         try {
447 452
             const receiveBandwidth = getStatValue(now, 'receiveBandwidth');
448 453
             const sendBandwidth = getStatValue(now, 'sendBandwidth');

Loading…
Cancel
Save