[FIX] mail: prevent blocking datachannel access if one is unavailable

Before this commit, if one RTCDataChannel was not available, signaling
using the RTDDataChannels was faulty.

This commit fixes this issue by skipping unavailable dataChannels.

closes odoo/odoo#76102

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Thanh Dodeur
2021-09-07 18:08:20 +00:00
parent 63ff23c218
commit 0051fda788
+1 -1
View File
@@ -633,7 +633,7 @@ function factory(dependencies) {
for (const token of targetTokens) {
const dataChannel = this._dataChannels[token];
if (!dataChannel || dataChannel.readyState !== 'open') {
return;
continue;
}
dataChannel.send(content);
}