From 4241f8522db780e33b787716d248acadb9340eaa Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Wed, 2 Aug 2023 21:28:39 -0400 Subject: [PATCH] =?UTF-8?q?fix(search):=20=F0=9F=90=9B=20exit=20early=20if?= =?UTF-8?q?=20there=20are=20no=20query=20results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.search/searchClients/mwActionApi.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/skins.citizen.search/searchClients/mwActionApi.js b/resources/skins.citizen.search/searchClients/mwActionApi.js index 65dfa19d..98e9df9a 100644 --- a/resources/skins.citizen.search/searchClients/mwActionApi.js +++ b/resources/skins.citizen.search/searchClients/mwActionApi.js @@ -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