1
0
mirror of https://github.com/searx/searx synced 2024-12-28 20:15:10 +01:00

[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'.
This commit is contained in:
Alexandre Flament 2020-12-07 17:42:05 +01:00
parent cdceec1cbb
commit 58d51e082d

View File

@ -52,7 +52,7 @@ def response(resp):
api_result = loads(resp.text)
# skip disambiguation pages
if api_result['type'] != 'standard':
if api_result.get('type') != 'standard':
return []
title = api_result['title']