Преглед на файлове

[fix] handling missing github descriptions

asciimoo преди 11 години
родител
ревизия
708fa6f88a
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4
    1
      searx/engines/github.py

+ 4
- 1
searx/engines/github.py Целия файл

@@ -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