From cd13ea99351f8eebf49ec811a5435ff103eb34e9 Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Tue, 19 Apr 2016 15:51:25 +0200 Subject: [PATCH] [FIX] mail: race condition in mail composer When an user sends an email from the chatter then quickly switch to another record, it may happen that this.composer is already destroyed. We prevent to display a traceback with this fix. --- addons/mail/static/src/js/chatter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index d57deed0802..2690d6c2444 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -919,7 +919,7 @@ var Chatter = form_common.AbstractField.extend({ this.mute_new_message_button(true); }, close_composer: function (force) { - if (this.composer.is_empty() || force) { + if (this.composer && (this.composer.is_empty() || force)) { this.composer.do_hide(); this.composer.$input.val(''); this.mute_new_message_button(false);