浏览代码

Merge pull request #299 from jitsi/msg_for_missing_participant

Fix Uncaught TypeError: Cannot read property 'getTracks' of undefined
dev1
hristoterezov 9 年前
父节点
当前提交
7caf4542d6
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 10
    3
      JitsiConferenceEventManager.js

+ 10
- 3
JitsiConferenceEventManager.js 查看文件

@@ -481,9 +481,16 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function () {
481 481
 
482 482
     conference.rtc.addListener(RTCEvents.ENDPOINT_MESSAGE_RECEIVED,
483 483
         function (from, payload) {
484
-            conference.eventEmitter.emit(
485
-                JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
486
-                conference.getParticipantById(from), payload);
484
+            const participant = conference.getParticipantById(from);
485
+            if (participant) {
486
+                conference.eventEmitter.emit(
487
+                    JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
488
+                    participant, payload);
489
+            } else {
490
+                logger.warn(
491
+                    "Ignored ENDPOINT_MESSAGE_RECEIVED " +
492
+                    "for not existing participant: " + from, payload);
493
+            }
487 494
         });
488 495
 };
489 496
 

正在加载...
取消
保存