소스 검색

Fixes crash (#452)

* fix(JingleSessionPC): do not log whole object
* fix(JitsiConference): fix a crash

The code will crash if there's neither P2P nor JVB session yet.
tags/v0.0.2
Paweł Domas 8 년 전
부모
커밋
f02e52e1f4
2개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. 1
    1
      JitsiConference.js
  2. 10
    1
      modules/xmpp/JingleSessionPC.js

+ 1
- 1
JitsiConference.js 파일 보기

@@ -1762,7 +1762,7 @@ JitsiConference.prototype._onTrackAttach = function(track, container) {
1762 1762
     } else {
1763 1763
         ssrc = track.getSSRC();
1764 1764
     }
1765
-    if (!container.id || !ssrc) {
1765
+    if (!container.id || !ssrc || !peerConnection) {
1766 1766
         return;
1767 1767
     }
1768 1768
 

+ 10
- 1
modules/xmpp/JingleSessionPC.js 파일 보기

@@ -977,7 +977,7 @@ export default class JingleSessionPC extends JingleSession {
977 977
         // Do something with reason and reasonCondition when we start to care
978 978
         // this.reasonCondition = reasonCondition;
979 979
         // this.reasonText = reasonText;
980
-        logger.info('Session terminated', this, reasonCondition, reasonText);
980
+        logger.info(`Session terminated ${this}`, reasonCondition, reasonText);
981 981
 
982 982
         this.close();
983 983
     }
@@ -1813,4 +1813,13 @@ export default class JingleSessionPC extends JingleSession {
1813 1813
                     && this.peerconnection.connectionState !== 'closed'))
1814 1814
             && this.peerconnection.close();
1815 1815
     }
1816
+
1817
+    /**
1818
+     * Converts to string with minor summary.
1819
+     * @return {string}
1820
+     */
1821
+    toString() {
1822
+        return `JingleSessionPC[p2p=${this.isP2P},`
1823
+                    + `initiator=${this.isInitiator},sid=${this.sid}]`;
1824
+    }
1816 1825
 }

Loading…
취소
저장