summaryrefslogtreecommitdiff
path: root/searx/results.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-09-10 17:53:49 +0200
committerAlexandre Flament <alex@al-f.net>2021-09-10 17:58:19 +0200
commitd9658a7f914e21f4a2beff8d798664f3621c4a69 (patch)
tree90a9dbb5ada62200d1dde2546f178e75fbc90734 /searx/results.py
parent75daef8986142bff65ef67aff4f278e41a4d0854 (diff)
downloadsearxng-d9658a7f914e21f4a2beff8d798664f3621c4a69.tar.gz
searxng-d9658a7f914e21f4a2beff8d798664f3621c4a69.zip
[fix] searx/results.py: strip result['content'] only if it exists
fix PR #302
Diffstat (limited to 'searx/results.py')
-rw-r--r--searx/results.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/results.py b/searx/results.py
index ae8cf2498..2e81f5dc4 100644
--- a/searx/results.py
+++ b/searx/results.py
@@ -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