From b5885f0cb02ba6853e17eb93009b1ebad2ff8d35 Mon Sep 17 00:00:00 2001 From: jev Date: Tue, 5 Mar 2019 10:36:23 +0000 Subject: [PATCH] [FIX] mail: popover email icon without any customer email data Before this commit, when hovering on a email icon of a message in chatter without any customer email data, there was a crash with the following error message: "No enumerator given to foreach" This was caused by `undefined` being passed to `t-foreach` when there are no customer email data on the message. Since `undefined == null`, it raised the error above. closes odoo/odoo#31587 Signed-off-by: =?utf-8?b?QWxleGFuZHJlIEvDvGhuIChha3Up?= --- addons/mail/static/src/js/thread_widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/thread_widget.js b/addons/mail/static/src/js/thread_widget.js index 39b32fbb499..269024b25bc 100644 --- a/addons/mail/static/src/js/thread_widget.js +++ b/addons/mail/static/src/js/thread_widget.js @@ -475,7 +475,7 @@ var ThreadWidget = Widget.extend({ return message.getID() === messageID; }); return QWeb.render('mail.widget.Thread.Message.MailTooltip', { - data: message.getCustomerEmailData() + data: message.hasCustomerEmailData() ? message.getCustomerEmailData() : [], }); }, });