From cebbee89291b130e2657130d4b56eea574ab66e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 18 Sep 2017 15:11:19 +0200 Subject: [PATCH] [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 --- addons/mail/static/src/js/client_action.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js index 52e67c60f68..9f43a9f08df 100644 --- a/addons/mail/static/src/js/client_action.js +++ b/addons/mail/static/src/js/client_action.js @@ -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); },