Skip to content

Commit

Permalink
handle None value in field index
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed Apr 21, 2017
1 parent 67b96a1 commit 7f5dc0e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/zope/index/field/index.py
Expand Up @@ -66,11 +66,12 @@ def index_doc(self, docid, value):

try:
# Insert into forward index.
set = self._fwd_index.get(value)
if set is None:
set = self.family.IF.TreeSet()
self._fwd_index[value] = set
set.insert(docid)
if value is not None:
set = self._fwd_index.get(value)
if set is None:
set = self.family.IF.TreeSet()
self._fwd_index[value] = set
set.insert(docid)
except TypeError:
# TypeError is caused by improper keys on the latest version of BTree
pass
Expand Down

0 comments on commit 7f5dc0e

Please sign in to comment.