summary refs log tree commit diff
path: root/webclient/components
diff options
context:
space:
mode:
authorDavid Baker <dbkr@matrix.org>2014-09-09 17:58:26 +0100
committerDavid Baker <dbkr@matrix.org>2014-09-09 17:58:26 +0100
commitccfb42e4ff612cab14318e16436984d2554a13c0 (patch)
tree9f5b4f8ead8b50ae5f13c5629e3ed3b59b6062a1 /webclient/components
parentDon't break if you press the hangup button before allowing media permission. (diff)
downloadsynapse-ccfb42e4ff612cab14318e16436984d2554a13c0.tar.xz
Don't try setting up the call if the user has canceled it before allowing permission.
Diffstat (limited to 'webclient/components')
-rw-r--r--webclient/components/matrix/matrix-call.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/webclient/components/matrix/matrix-call.js b/webclient/components/matrix/matrix-call.js
index ef35717da6..16f22fe364 100644
--- a/webclient/components/matrix/matrix-call.js
+++ b/webclient/components/matrix/matrix-call.js
@@ -117,6 +117,8 @@ angular.module('MatrixCall', [])
     };
 
     MatrixCall.prototype.gotUserMediaForInvite = function(stream) {
+        if (!$rootScope.currentCall || $rootScope.currentCall.state == 'ended') return;
+
         this.localAVStream = stream;
         var audioTracks = stream.getAudioTracks();
         for (var i = 0; i < audioTracks.length; i++) {
@@ -140,6 +142,8 @@ angular.module('MatrixCall', [])
     };
 
     MatrixCall.prototype.gotUserMediaForAnswer = function(stream) {
+        if (!$rootScope.currentCall || $rootScope.currentCall.state == 'ended') return;
+
         this.localAVStream = stream;
         var audioTracks = stream.getAudioTracks();
         for (var i = 0; i < audioTracks.length; i++) {