From 044dbfcd38c3996b41e3c13c21185cd9c8b4c955 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 12 Sep 2014 16:15:00 -0700 Subject: [PATCH] NumericQuery: Check that the field exists --- beets/dbcore/query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beets/dbcore/query.py b/beets/dbcore/query.py index 7197d2564..1f1a9a26a 100644 --- a/beets/dbcore/query.py +++ b/beets/dbcore/query.py @@ -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)