Selaa lähdekoodia

[fix] not highlighting Nonetype

asciimoo 11 vuotta sitten
vanhempi
commit
5f065886ff
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3
    0
      searx/engines/__init__.py

+ 3
- 0
searx/engines/__init__.py Näytä tiedosto

@@ -107,6 +107,9 @@ def make_callback(engine_name, results, suggestions, callback, params):
107 107
     return process_callback
108 108
 
109 109
 def highlight_content(content, query):
110
+
111
+    if not content:
112
+        return None
110 113
     # ignoring html contents
111 114
     # TODO better html content detection
112 115
     if content.find('<') != -1: