From bcc3a86121c0849f7f3f68818688309c07a2490c Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Thu, 30 Apr 2015 18:14:15 +0200 Subject: [PATCH] Return empty stream lists when there is no internal peer connection. --- static/js/mediastream/peerconnection.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/js/mediastream/peerconnection.js b/static/js/mediastream/peerconnection.js index 177094a0..56defc76 100644 --- a/static/js/mediastream/peerconnection.js +++ b/static/js/mediastream/peerconnection.js @@ -314,12 +314,18 @@ define(['jquery', 'underscore', 'webrtc.adapter'], function($, _) { PeerConnection.prototype.getRemoteStreams = function() { + if (!this.pc) { + return []; + } return this.pc.getRemoteStreams.apply(this.pc, arguments); }; PeerConnection.prototype.getLocalStreams = function() { + if (!this.pc) { + return []; + } return this.pc.getRemoteStreams.apply(this.pc, arguments); };