diff --git a/library/Icinga/Data/Db/DbQuery.php b/library/Icinga/Data/Db/DbQuery.php index e89236df5..bad1261aa 100644 --- a/library/Icinga/Data/Db/DbQuery.php +++ b/library/Icinga/Data/Db/DbQuery.php @@ -162,7 +162,10 @@ class DbQuery extends SimpleQuery $parts = array(); if (! $filter->isEmpty()) { foreach ($filter->filters() as $f) { - $parts[] = $this->renderFilter($f, $level + 1); + $filterPart = $this->renderFilter($f, $level + 1); + if ($filterPart !== '') { + $parts[] = $filterPart; + } } if ($level > 0) { $str .= ' (' . implode($op, $parts) . ') ';