[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.
This commit is contained in:
Richard Mathot
2016-04-19 17:01:44 +02:00
committed by Géry Debongnie
parent 17d0117edc
commit cd13ea9935
+1 -1
View File
@@ -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);