forked from Ponysearch/Ponysearch
[fix] handling empty resultset
This commit is contained in:
parent
1e8af70192
commit
126682a6ce
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue