mirror of https://github.com/searx/searx
[fix] handling empty resultsets III.
This commit is contained in:
parent
e1768ed292
commit
7ce7aaed3d
|
@ -16,9 +16,9 @@ def response(resp):
|
||||||
global base_url
|
global base_url
|
||||||
results = []
|
results = []
|
||||||
search_res = loads(resp.text)
|
search_res = loads(resp.text)
|
||||||
if 'responseData' not in search_res:
|
if not search_res.get('responseData'):
|
||||||
return []
|
return []
|
||||||
if 'results' not in search_res['responseData'] and search_res['responseData']['results']:
|
if not search_res['responseData'].get('results'):
|
||||||
return []
|
return []
|
||||||
for result in search_res['responseData']['results']:
|
for result in search_res['responseData']['results']:
|
||||||
url = result['originalContextUrl']
|
url = result['originalContextUrl']
|
||||||
|
|
Loading…
Reference in New Issue