web/facet.py
changeset 5238 31c12863fd9d
parent 5174 78438ad513ca
parent 5225 9ff0dee81eb2
child 5423 e15abfdcce38
--- a/web/facet.py	Tue Apr 13 19:43:30 2010 +0200
+++ b/web/facet.py	Tue Apr 13 19:43:51 2010 +0200
@@ -382,7 +382,9 @@
                 return ()
         finally:
             rqlst.recover()
-        return self.rset_vocabulary(rset)
+        # don't call rset_vocabulary on empty result set, it may be an empty
+        # *list* (see rqlexec implementation)
+        return rset and self.rset_vocabulary(rset)
 
     def possible_values(self):
         """return a list of possible values (as string since it's used to
@@ -471,7 +473,9 @@
                 return ()
         finally:
             rqlst.recover()
-        return self.rset_vocabulary(rset)
+        # don't call rset_vocabulary on empty result set, it may be an empty
+        # *list* (see rqlexec implementation)
+        return rset and self.rset_vocabulary(rset)
 
     def rset_vocabulary(self, rset):
         _ = self._cw._