Przeglądaj źródła

Add a check for 'undefined' RTCStatsReport objecs

dev1
Sean Heffernan 8 lat temu
rodzic
commit
3609dcb382
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5
    0
      modules/statistics/RTPStatsCollector.js

+ 5
- 0
modules/statistics/RTPStatsCollector.js Wyświetl plik

@@ -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');

Ładowanie…
Anuluj
Zapisz