Browse Source

[fix] handling missing github descriptions

asciimoo 11 years ago
parent
commit
708fa6f88a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      searx/engines/github.py

+ 4 - 1
searx/engines/github.py

@@ -21,6 +21,9 @@ def response(resp):
     for res in search_res['items']:
     for res in search_res['items']:
         title = res['name']
         title = res['name']
         url = res['html_url']
         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})
         results.append({'url': url, 'title': title, 'content': content})
     return results
     return results