diff --git a/addons/mail/static/src/models/chat_window_manager.js b/addons/mail/static/src/models/chat_window_manager.js index 01e20877da65f..9d99d6700459b 100644 --- a/addons/mail/static/src/models/chat_window_manager.js +++ b/addons/mail/static/src/models/chat_window_manager.js @@ -239,7 +239,7 @@ registerModel({ ); let amount = 0; for (const chatWindow of allHiddenWithThread) { - if (chatWindow.thread.channel.localMessageUnreadCounter > 0) { + if (chatWindow.thread.channel && chatWindow.thread.channel.localMessageUnreadCounter > 0) { amount++; } }