From 6650188d2cdaaa6b35f7a0852b1dd4e87203fe98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Mon, 10 Oct 2022 14:11:05 +0000 Subject: [PATCH] [FIX] mail: no crash when click on failure in mobile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, when clicking on a mail failure in the messaging menu in mobile, it crashed. `NotificationGroupView` is already destroyed, so it crashed due to attempting to access a field (`messaging`) Task-3013202 closes odoo/odoo#102986 X-original-commit: 73b94715f0d0086d361937491c27c611a03a9f67 Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/models/notification_group_view.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/models/notification_group_view.js b/addons/mail/static/src/models/notification_group_view.js index f0fd24d61ec..707b371c435 100644 --- a/addons/mail/static/src/models/notification_group_view.js +++ b/addons/mail/static/src/models/notification_group_view.js @@ -19,9 +19,10 @@ registerModel({ // handled in `_onClickMarkAsRead` return; } + const messaging = this.messaging; this.notificationGroup.openDocuments(); - if (!this.messaging.device.isSmall) { - this.messaging.messagingMenu.close(); + if (!messaging.device.isSmall) { + messaging.messagingMenu.close(); } }, /**