From 53c6ceb9090e30f3c2e9540dcbadac9344221d5d Mon Sep 17 00:00:00 2001 From: Thanh Dodeur Date: Mon, 6 Sep 2021 11:27:38 +0000 Subject: [PATCH] [FIX] mail: prevents video access traceback after ending a call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, it was assumed that the call was still active when the video permission was granted, this assumption was false and this commit fixes this issue. closes odoo/odoo#75999 Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/models/rtc/rtc.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/static/src/models/rtc/rtc.js b/addons/mail/static/src/models/rtc/rtc.js index cbe15c844e3..e37c9e7350c 100644 --- a/addons/mail/static/src/models/rtc/rtc.js +++ b/addons/mail/static/src/models/rtc/rtc.js @@ -795,6 +795,9 @@ function factory(dependencies) { const sendDisplay = force !== undefined ? force : !this.sendDisplay; await this._updateLocalVideoTrack(type, sendDisplay); } + if (!this.currentRtcSession) { + return; + } if (!this.videoTrack) { this.currentRtcSession.removeVideo(); } else {