[fix] wikipedia: minor fix: return no result instead of crash in some very few cases.
In few cases, the JSON results doesn't contains the key 'type'.
commit58d51e082d9434496aebef8792ed58b62bc31707
authorAlexandre Flament <alex@al-f.net>
dateMon 7 Dec 2020, 17:42 (6 years ago)
parentcdceec1
searx/engines/wikipedia.py+1−1
@@ -52,7 +52,7 @@ def response(resp):
5252 api_result = loads(resp.text)
5353
5454 # skip disambiguation pages
55− if api_result['type'] != 'standard':
55+ if api_result.get('type') != 'standard':
5656 return []
5757
5858 title = api_result['title']