diff --git a/src/webrtc/call.js b/src/webrtc/call.js index 1ad12c8d2..f730a2067 100644 --- a/src/webrtc/call.js +++ b/src/webrtc/call.js @@ -516,8 +516,10 @@ MatrixCall.prototype._gotUserMediaForInvite = function(stream) { }, 0); } - this.screenSharingStream.addTrack(stream.getAudioTracks()[0]); - stream = this.screenSharingStream; + if (this.screenSharingStream) { + this.screenSharingStream.addTrack(stream.getAudioTracks()[0]); + stream = this.screenSharingStream; + } this.localAVStream = stream; // why do we enable audio (and only audio) tracks here? -- matthew