summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2019-12-21 21:01:08 +0100
committerAdam Tauber <asciimoo@gmail.com>2019-12-21 21:01:08 +0100
commit00512e36c133312eb74a82f6a2dec6d06214c42b (patch)
tree8b2a464cd93638f2dbfcaea4703f40f754e8b3df /searx
parentf8713512bedf19d4495e0b9a0fd86679daaf7f79 (diff)
downloadsearxng-00512e36c133312eb74a82f6a2dec6d06214c42b.tar.gz
searxng-00512e36c133312eb74a82f6a2dec6d06214c42b.zip
[fix] handle empty response from wikipedia engine - closes #1114
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/wikipedia.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/searx/engines/wikipedia.py b/searx/engines/wikipedia.py
index 4dae735d1..690da72fe 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: