summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--searx/engines/pdbe.py2
-rw-r--r--searx/results.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/searx/engines/pdbe.py b/searx/engines/pdbe.py
index 6dcb56169..a155c02fd 100644
--- a/searx/engines/pdbe.py
+++ b/searx/engines/pdbe.py
@@ -67,7 +67,7 @@ def construct_body(result):
)
thumbnail = pdbe_preview_url.format(pdb_id=result['pdb_id'])
except KeyError:
- content = None
+ content = ""
thumbnail = None
# construct url for preview image
diff --git a/searx/results.py b/searx/results.py
index 02b7bb204..f3bac2eb7 100644
--- a/searx/results.py
+++ b/searx/results.py
@@ -357,12 +357,12 @@ def merge_two_infoboxes(origin: LegacyResult, other: LegacyResult):
def merge_two_main_results(origin: MainResult | LegacyResult, other: MainResult | LegacyResult):
"""Merges the values from ``other`` into ``origin``."""
- if len(other.content) > len(origin.content):
+ if len(other.content or "") > len(origin.content or ""):
# use content with more text
origin.content = other.content
# use title with more text
- if len(other.title) > len(origin.title):
+ if len(other.title or "") > len(origin.title or ""):
origin.title = other.title
# merge all result's parameters not found in origin