fix(search): 🐛 exit early if there are no query results

This commit is contained in:
alistair3149 2023-08-02 21:28:39 -04:00
parent 17593b8202
commit 4241f8522d
No known key found for this signature in database

View file

@ -60,6 +60,11 @@ function adaptApiResponse( config, query, response, showDescription ) {
}
};
// Early exit with there are no query
if ( !response.query ) {
return { query, results: {} };
}
response = response.query;
// Merge redirects array into pages array if avaliable