From: Italo Rossi Date: Sat, 21 Apr 2018 21:11:12 +0000 (-0300) Subject: FS-11044 - [verto_communicator] Fix error when muting/unmuting without cam and/or... X-Git-Tag: v1.8.1~3^2~223 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba7b003bc276e64ec197e992e74a13fedc8fadc5;p=thirdparty%2Ffreeswitch.git FS-11044 - [verto_communicator] Fix error when muting/unmuting without cam and/or mic. --- diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index ed8a5500d8..f07188bedb 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -341,6 +341,9 @@ $.FSRTC.prototype.setMute = function(what) { var self = this; + if (!self.localStream) { + return false; + } var audioTracks = self.localStream.getAudioTracks(); for (var i = 0, len = audioTracks.length; i < len; i++ ) { @@ -370,6 +373,9 @@ $.FSRTC.prototype.setVideoMute = function(what) { var self = this; + if (!self.localStream) { + return false; + } var videoTracks = self.localStream.getVideoTracks(); for (var i = 0, len = videoTracks.length; i < len; i++ ) {