From 708fa6f88af8a2e0fa1a02e1603c6b231e68b212 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Wed, 23 Oct 2013 12:24:09 +0200 Subject: [PATCH] [fix] handling missing github descriptions --- searx/engines/github.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/searx/engines/github.py b/searx/engines/github.py index 591fd14a..85540056 100644 --- a/searx/engines/github.py +++ b/searx/engines/github.py @@ -21,6 +21,9 @@ def response(resp): for res in search_res['items']: title = res['name'] url = res['html_url'] - content = escape(res['description'][:500]) + if res['description']: + content = escape(res['description'][:500]) + else: + content = '' results.append({'url': url, 'title': title, 'content': content}) return results