diff --git a/addons/mail/static/src/core/web/chat_window_service_patch.js b/addons/mail/static/src/core/web/chat_window_service_patch.js index 6f5668129a9..3c8b2f08934 100644 --- a/addons/mail/static/src/core/web/chat_window_service_patch.js +++ b/addons/mail/static/src/core/web/chat_window_service_patch.js @@ -12,7 +12,7 @@ patch(ChatWindowService.prototype, "mail/core/web", { // chat window was opened from the messaging menu. In that // case it should be re-opened to simulate it was always // there in the background. - document.querySelector(".o_menu_systray i[aria-label='Messages']").click(); + document.querySelector(".o_menu_systray i[aria-label='Messages']")?.click(); // ensure messaging menu is opened before chat window is closed await Promise.resolve(); }