diff --git a/library/Icinga/Data/SimpleQuery.php b/library/Icinga/Data/SimpleQuery.php index 2d0eeef6f..ae1e589b1 100644 --- a/library/Icinga/Data/SimpleQuery.php +++ b/library/Icinga/Data/SimpleQuery.php @@ -450,7 +450,17 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator */ public function hasResult() { - return $this->iteratorPosition !== null || $this->fetchRow() !== false; + if ($this->iteratorPosition !== null) { + return true; + } + + $hasResult = false; + foreach ($this as $row) { + $hasResult = true; + break; + } + + return $hasResult; } /**