Skip to content

Commit

Permalink
Check value is not None before inserting into forward index
Browse files Browse the repository at this point in the history
  • Loading branch information
vangheem committed Aug 20, 2015
1 parent 126d950 commit d1f299a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/zope/index/field/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ def index_doc(self, docid, value):
# unindex doc if present
self.unindex_doc(docid)

# 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:
# 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)

# increment doc count
self._num_docs.change(1)
Expand Down

0 comments on commit d1f299a

Please sign in to comment.