Explorar el Código

[fix] handling missing github descriptions

asciimoo hace 11 años
padre
commit
708fa6f88a
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4
    1
      searx/engines/github.py

+ 4
- 1
searx/engines/github.py Ver fichero

@@ -21,6 +21,9 @@ def response(resp):
21 21
     for res in search_res['items']:
22 22
         title = res['name']
23 23
         url = res['html_url']
24
-        content = escape(res['description'][:500])
24
+        if res['description']:
25
+            content = escape(res['description'][:500])
26
+        else:
27
+            content = ''
25 28
         results.append({'url': url, 'title': title, 'content': content})
26 29
     return results