1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 12:10:11 +01:00

[fix] handling empty resultsets III.

This commit is contained in:
asciimoo 2013-10-20 21:40:14 +02:00
parent e1768ed292
commit 7ce7aaed3d

View File

@ -16,9 +16,9 @@ def response(resp):
global base_url
results = []
search_res = loads(resp.text)
if 'responseData' not in search_res:
if not search_res.get('responseData'):
return []
if 'results' not in search_res['responseData'] and search_res['responseData']['results']:
if not search_res['responseData'].get('results'):
return []
for result in search_res['responseData']['results']:
url = result['originalContextUrl']