diff --git a/search/engine/solr/classes/engine.php b/search/engine/solr/classes/engine.php index 8ca37e2def6..875f3d11cc2 100644 --- a/search/engine/solr/classes/engine.php +++ b/search/engine/solr/classes/engine.php @@ -243,7 +243,9 @@ class engine extends \core_search\engine { } else if (isset($response->response->numFound)) { // Get the number of results for standard queries. $found = $response->response->numFound; - $included = count($response->response->docs); + if ($found > 0 && is_array($response->response->docs)) { + $included = count($response->response->docs); + } } return array($included, $found);