mirror of
https://github.com/searxng/searxng
synced 2024-11-03 09:40:20 +00:00
[fix] handling empty resultset
This commit is contained in:
parent
1e8af70192
commit
126682a6ce
@ -18,6 +18,8 @@ def response(resp):
|
|||||||
search_res = loads(resp.text)
|
search_res = loads(resp.text)
|
||||||
if 'responseData' not in search_res:
|
if 'responseData' not in search_res:
|
||||||
return []
|
return []
|
||||||
|
if 'results' not in search_res['responseData']:
|
||||||
|
return []
|
||||||
for result in search_res['responseData']['results']:
|
for result in search_res['responseData']['results']:
|
||||||
url = result['originalContextUrl']
|
url = result['originalContextUrl']
|
||||||
title = result['title']
|
title = result['title']
|
||||||
|
Loading…
Reference in New Issue
Block a user