From 6b07bce0ec2c0dc1a308c94e476bf0409b59704b Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 22 Mar 2018 09:07:28 +0100 Subject: [PATCH] [FIX] mail: strip comments when inlining When an unread message contains conditional html statements, clicking on the discuss tray icon produces a JS traceback. This is due to `node.tagName` being undefined. When inlining, there is no need for these comments. opw-1829641 --- addons/mail/static/src/js/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js index 22e9a51b9dd..8ece5ef5040 100644 --- a/addons/mail/static/src/js/utils.js +++ b/addons/mail/static/src/js/utils.js @@ -92,6 +92,7 @@ function strip_html (node, transform_children) { function inline (node, transform_children) { if (node.nodeType === 3) return node.data; + if (node.nodeType === 8) return ""; if (node.tagName === "BR") return " "; if (node.tagName.match(/^(A|P|DIV|PRE|BLOCKQUOTE)$/)) return transform_children(); node.innerHTML = transform_children();