瀏覽代碼

[fix] not highlighting Nonetype

asciimoo 11 年之前
父節點
當前提交
5f065886ff
共有 1 個檔案被更改,包括 3 行新增0 行删除
  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):
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: