1
0
mirror of https://github.com/searxng/searxng.git synced 2024-07-02 15:30:42 +02:00

Merge pull request #311 from dalf/fix-pr-302

[fix] searx/results.py: strip result['content'] only if it exists
This commit is contained in:
Markus Heiser 2021-09-10 16:10:33 +00:00 committed by GitHub
commit 76e0f6807c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,7 +255,8 @@ class ResultContainer:
result['url'] = result['parsed_url'].geturl()
# strip multiple spaces and cariage returns from content
result['content'] = WHITESPACE_REGEX.sub(' ', result['content'])
if result.get('content'):
result['content'] = WHITESPACE_REGEX.sub(' ', result['content'])
return True