Permalink
Browse files

Added check on argument in joinMultipleWheres

  • Loading branch information...
1 parent 7abcc35 commit 5ac5828ebddb3f01a24a9c3d6cffd1ac0c6a2589 @flaviogrossi flaviogrossi committed Jun 28, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 twistar/utils.py
View
@@ -57,6 +57,8 @@ def joinMultipleWheres(wheres, joiner="AND"):
@return: A joined version of the list of th given wheres.
"""
+ if not wheres:
+ return []
f = lambda x, y: joinWheres(x, y, joiner)
wheres = [w for w in wheres if w] # discard empty wheres
return reduce(f, wheres)

0 comments on commit 5ac5828

Please sign in to comment.