summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
diff options
context:
space:
mode:
authorDavid Beguin <dbe@odoo.com>2019-07-09 15:20:37 +0000
committerDavid Beguin <dbe@odoo.com>2019-07-16 13:49:14 +0000
commit3a804ecac8fb55324ba4dc233eb40e9508679175 (patch)
treee4fe54da4bc66ebf9da14299c032fa6a20b8a69d /addons/mail/static/src/js/thread_windows/abstract_thread_window.js
parent3b223c11fdffd443ba3c53936bb4f43389859072 (diff)
[FIX] mail : fix post message callback error
When posting a message (here is the livechat use case), the _postMessage function can call the callback function. but this parameter is not mandatory. If the caller of this function doesn't need a callback function to be called after execution, the _postMessage function was crashing as callback is not defined. This commit fix this _postMessage function by checking that callback is defined before calliing it. Pre-required for Task ID: 2028059 Fix Task : 2037048 PR #34917 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/mail/static/src/js/thread_windows/abstract_thread_window.js')
-rw-r--r--addons/mail/static/src/js/thread_windows/abstract_thread_window.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
index 0af2d1080db..d6a637a0552 100644
--- a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
+++ b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
@@ -404,7 +404,7 @@ var AbstractThreadWindow = Widget.extend({
this._thread.postMessage(messageData)
.then(function () {
self._threadWidget.scrollToBottom();
- callback();
+ callback && callback();
});
},
/**