Procházet zdrojové kódy

[fix] handling missing github descriptions

asciimoo před 11 roky
rodič
revize
708fa6f88a
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4
    1
      searx/engines/github.py

+ 4
- 1
searx/engines/github.py Zobrazit soubor

21
     for res in search_res['items']:
21
     for res in search_res['items']:
22
         title = res['name']
22
         title = res['name']
23
         url = res['html_url']
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
         results.append({'url': url, 'title': title, 'content': content})
28
         results.append({'url': url, 'title': title, 'content': content})
26
     return results
29
     return results