From 58d51e082d9434496aebef8792ed58b62bc31707 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Mon, 7 Dec 2020 17:42:05 +0100 Subject: [PATCH] [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'. --- searx/engines/wikipedia.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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']