From fdd09b60c752a7ac46a2f20b22a17bdb5e6288b5 Mon Sep 17 00:00:00 2001 From: Thanh Dodeur Date: Thu, 9 Sep 2021 07:19:53 +0000 Subject: [PATCH] [FIX] mail: prevent unnecessary re instantiation of the callViewer model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the callViewer model was re instantiated in cases when the amount of RTC session would change, which was not necessary if the call viewer was already present. This could cause tracebacks accessing deleted callViewers. closes odoo/odoo#76328 X-original-commit: d2c9cc55bbabd21cbbbc8a0e77f6935fdafddeea Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/models/thread_view/thread_view.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/static/src/models/thread_view/thread_view.js b/addons/mail/static/src/models/thread_view/thread_view.js index 5eca6d7f2ec..c18adfe9a81 100644 --- a/addons/mail/static/src/models/thread_view/thread_view.js +++ b/addons/mail/static/src/models/thread_view/thread_view.js @@ -72,6 +72,9 @@ function factory(dependencies) { */ _computeRtcCallViewer() { if (this.thread && this.thread.model === 'mail.channel' && this.thread.rtcSessions.length > 0) { + if (this.rtcCallViewer) { + return; + } return create(); } return unlink();