[fix] handling missing github descriptions
commit708fa6f88af8a2e0fa1a02e1603c6b231e68b212
authorasciimoo <asciimoo@gmail.com>
dateWed 23 Oct 2013, 12:24 (13 years ago)
parente2c0990
searx/engines/github.py+4−1
@@ -21,6 +21,9 @@ def response(resp):
2121 for res in search_res['items']:
2222 title = res['name']
2323 url = res['html_url']
24− content = escape(res['description'][:500])
24+ if res['description']:
25+ content = escape(res['description'][:500])
26+ else:
27+ content = ''
2528 results.append({'url': url, 'title': title, 'content': content})
2629 return results