Merge pull request #122 from pointhi/bugfix

[fix] #121, HTTP 500 Error if res["content"] == None
This commit is contained in:
Adam Tauber 2014-11-01 17:49:18 +01:00
commit ee8cabf496

View file

@ -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', ''))