From 00512e36c133312eb74a82f6a2dec6d06214c42b Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sat, 21 Dec 2019 21:01:08 +0100 Subject: [PATCH] [fix] handle empty response from wikipedia engine - closes #1114 --- searx/engines/wikipedia.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/searx/engines/wikipedia.py b/searx/engines/wikipedia.py index 4dae735d..690da72f 100644 --- a/searx/engines/wikipedia.py +++ b/searx/engines/wikipedia.py @@ -79,6 +79,9 @@ def response(resp): # wikipedia article's unique id # first valid id is assumed to be the requested article + if 'pages' not in search_result['query']: + return results + for article_id in search_result['query']['pages']: page = search_result['query']['pages'][article_id] if int(article_id) > 0: