NumericQuery: Check that the field exists

This commit is contained in:
Adrian Sampson 2014-09-12 16:15:00 -07:00 committed by Thomas Scholtes
parent 5dec867ab3
commit 044dbfcd38

View file

@ -208,7 +208,9 @@ class NumericQuery(FieldQuery):
self.rangemax = self._convert(parts[1])
def match(self, item):
value = getattr(item, self.field)
if self.field not in item:
return False
value = item[self.field]
if isinstance(value, basestring):
value = self._convert(value)