summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/search/__init__.py
diff options
context:
space:
mode:
authorJefferson Stachelski <jstachel@thoughtworks.com>2016-01-18 18:20:48 -0200
committerJefferson Stachelski <jstachel@thoughtworks.com>2016-01-20 11:18:32 -0200
commite7a093f55df2a5b5d1085618f66c807bc85b7b03 (patch)
tree654e0a4ecbe60848b0ba2b1b5e2e9f2bc8a648c9 /service/pixelated/adapter/search/__init__.py
parent5e17652b6fa0d6412a097c0ec63fa224f3d606e7 (diff)
Some work around that fixed jeffhsta wazokazi account
Diffstat (limited to 'service/pixelated/adapter/search/__init__.py')
-rw-r--r--service/pixelated/adapter/search/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/service/pixelated/adapter/search/__init__.py b/service/pixelated/adapter/search/__init__.py
index dbd4d288..35087101 100644
--- a/service/pixelated/adapter/search/__init__.py
+++ b/service/pixelated/adapter/search/__init__.py
@@ -115,8 +115,9 @@ class SearchEngine(object):
return FileIndex.create(storage, self._mail_schema(), indexname='mails')
def index_mail(self, mail):
- with AsyncWriter(self._index) as writer:
- self._index_mail(writer, mail)
+ if mail is not None:
+ with AsyncWriter(self._index) as writer:
+ self._index_mail(writer, mail)
def _index_mail(self, writer, mail):
mdict = mail.as_dict()