ソースを参照

[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