From bc7d4f214fb71e321fcf956ed91d5e76f4e13394 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 4 May 2015 15:34:03 +0300 Subject: [PATCH] fix email preview --- frontend/client/src/views/email/modals/detail.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); + } },