diff options
author | Alexandre Flament <alex@al-f.net> | 2020-12-07 17:42:05 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2020-12-07 17:42:05 +0100 |
commit | 58d51e082d9434496aebef8792ed58b62bc31707 (patch) | |
tree | eb3746dda19a34a4f2d242ea49088974506299f0 /searx/engines/wikipedia.py | |
parent | cdceec1cbb2ca894572396e0a68c2d09b0769231 (diff) | |
download | searxng-58d51e082d9434496aebef8792ed58b62bc31707.tar.gz searxng-58d51e082d9434496aebef8792ed58b62bc31707.zip |
[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'.
Diffstat (limited to 'searx/engines/wikipedia.py')
-rw-r--r-- | searx/engines/wikipedia.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/engines/wikipedia.py b/searx/engines/wikipedia.py index 9fce170eb..000e1af76 100644 --- a/searx/engines/wikipedia.py +++ b/searx/engines/wikipedia.py @@ -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'] |