summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread/thread.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/models/thread/thread.js')
-rw-r--r--addons/mail/static/src/models/thread/thread.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/mail/static/src/models/thread/thread.js b/addons/mail/static/src/models/thread/thread.js
index 31339e063f3..4739e59f91e 100644
--- a/addons/mail/static/src/models/thread/thread.js
+++ b/addons/mail/static/src/models/thread/thread.js
@@ -1344,6 +1344,9 @@ function factory(dependencies) {
const index = this.orderedMessages.findIndex(message =>
message.id === this.lastSeenByCurrentPartnerMessageId
);
+ if (index === -1) {
+ return [['unlink']];
+ }
const message = this.orderedMessages[index + 1];
if (!message) {
return [['unlink']];