diff options
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/adapter/services/mail_service.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py index bbaad2c5..7e6f1c63 100644 --- a/service/pixelated/adapter/services/mail_service.py +++ b/service/pixelated/adapter/services/mail_service.py @@ -123,10 +123,11 @@ class MailService(object): @defer.inlineCallbacks def delete_mail(self, mail_id): mail = yield self.mail(mail_id) - if mail.mailbox_name.upper() == u'TRASH': - yield self.mail_store.delete_mail(mail_id) - else: - yield self.mail_store.move_mail_to_mailbox(mail_id, 'TRASH') + if mail is not None: + if mail.mailbox_name.upper() == u'TRASH': + yield self.mail_store.delete_mail(mail_id) + else: + yield self.mail_store.move_mail_to_mailbox(mail_id, 'TRASH') @defer.inlineCallbacks def recover_mail(self, mail_id): |