Sfoglia il codice sorgente

Fix JS error returned by callstats when no error is passed to be reported

master
hristoterezov 9 anni fa
parent
commit
5ec7cd352d
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9
    0
      modules/statistics/CallStats.js

+ 9
- 0
modules/statistics/CallStats.js Vedi File

@@ -241,6 +241,10 @@ CallStats.sendDominantSpeakerEvent = _try_catch(function (cs) {
241 241
  * @private
242 242
  */
243 243
 CallStats._reportEvent = function (event) {
244
+    if(!event) {
245
+        logger.warn("No event is passed!");
246
+        return;
247
+    }
244 248
     if (callStats) {
245 249
         callStats.sendFabricEvent(this.peerconnection, event, this.confID);
246 250
     } else {
@@ -302,6 +306,11 @@ function(overallFeedback, detailedFeedback) {
302 306
  * @private
303 307
  */
304 308
 CallStats._reportError = function (type, e, pc) {
309
+    if(!e) {//nothing to report
310
+        logger.warn("No error is passed!");
311
+        return;
312
+    }
313
+
305 314
     if (callStats) {
306 315
         callStats.reportError(pc, this.confID, type, e);
307 316
     } else {

Loading…
Annulla
Salva