Browse Source

[fix] not highlighting Nonetype

asciimoo 11 years ago
parent
commit
5f065886ff
1 changed files with 3 additions and 0 deletions
  1. 3 0
      searx/engines/__init__.py

+ 3 - 0
searx/engines/__init__.py

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