diff --git a/frontend/client/src/views/email/modals/detail.js b/frontend/client/src/views/email/modals/detail.js index 48a25e6f1d..9b22bbbaad 100644 --- a/frontend/client/src/views/email/modals/detail.js +++ b/frontend/client/src/views/email/modals/detail.js @@ -31,11 +31,13 @@ Espo.define('Views.Email.Modals.Detail', ['Views.Modals.Detail', 'Views.Email.De 'label': 'Reply', 'style': 'danger' }); - this.listenToOnce(this.model, 'sync', function () { - setTimeout(function () { - this.model.set('isRead', true); - }.bind(this), 50); - }, this); + if (this.model) { + this.listenToOnce(this.model, 'sync', function () { + setTimeout(function () { + this.model.set('isRead', true); + }.bind(this), 50); + }, this); + } },