diff --git a/components/com_finder/src/Model/SearchModel.php b/components/com_finder/src/Model/SearchModel.php index 30da21a70b307..2d729cbb3f54a 100644 --- a/components/com_finder/src/Model/SearchModel.php +++ b/components/com_finder/src/Model/SearchModel.php @@ -260,6 +260,12 @@ protected function getListQuery() $query->order('ordering ' . $db->escape($direction)); + /* + * Prevent invalid records from being returned in the final query. + * This can happen if the search results are queried while the indexer is running. + */ + $query->where($db->quoteName('object') . ' != ' . $db->quote('')); + /* * If there are no optional or required search terms in the query, we * can get the results in one relatively simple database query.