diff options
| author | Bnyro <bnyro@tutanota.com> | 2025-02-08 16:51:37 +0100 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2025-02-08 17:18:43 +0100 |
| commit | 3a59aea742a50d80c77a47139012ff0ad04c1afb (patch) | |
| tree | 1e98547ed5784eab93f521d403143843456aa094 /searx/results.py | |
| parent | 28ead13eb95a8d852b27436733c8272e7f67dea7 (diff) | |
[fix] results.py: crashes when 'parsed_url' is None
Diffstat (limited to 'searx/results.py')
| -rw-r--r-- | searx/results.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/searx/results.py b/searx/results.py index b9cb90bbb..281607de0 100644 --- a/searx/results.py +++ b/searx/results.py @@ -318,8 +318,9 @@ class ResultContainer: def __find_duplicated_http_result(self, result): result_template = result.get('template') for merged_result in self._merged_results: - if 'parsed_url' not in merged_result: + if not merged_result.get('parsed_url'): continue + if compare_urls(result['parsed_url'], merged_result['parsed_url']) and result_template == merged_result.get( 'template' ): @@ -385,6 +386,9 @@ class ResultContainer: categoryPositions = {} for res in results: + if not res.get('url'): + continue + # do we need to handle more than one category per engine? engine = engines[res['engine']] res['category'] = engine.categories[0] if len(engine.categories) > 0 else '' |