[FIX] mail: prevent pos tour from sometimes failing

Here is what could (sometimes) happen in community:
- the point of sale tour is started by the runbot
- it loads the '/web' url
- this instantiate the mail client action (init)
- the tour sees that the POS link is in the dom and clicks on it
- the action manager destroys the discuss client action (before its
  start method is called)
- the destroy method from the client action is called, this.$buttons
  is not set, the destroy method causes a traceback
This commit is contained in:
Géry Debongnie
2017-09-18 15:39:06 +02:00
parent 8f02b16c27
commit cebbee8929
+3 -1
View File
@@ -660,7 +660,9 @@ var ChatAction = Widget.extend(ControlPanelMixin, {
});
},
destroy: function() {
this.$buttons.off().destroy();
if (this.$buttons) {
this.$buttons.off().destroy();
}
this._super.apply(this, arguments);
},