From 5a7f85eceef70dca1aef4f3899c5f9ab4975df22 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sat, 1 Nov 2014 17:32:26 +0100 Subject: [PATCH] [fix] #121, HTTP 500 Error if res["content"] == None --- searx/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/search.py b/searx/search.py index f051d6df2..0e7aaed8f 100644 --- a/searx/search.py +++ b/searx/search.py @@ -131,7 +131,7 @@ def score_results(results): weight = 1.0 # strip multiple spaces and cariage returns from content - if 'content' in res: + if res.get('content'): res['content'] = re.sub(' +', ' ', res['content'].strip().replace('\n', ''))