diff options
author | Alexandre Flament <alex@al-f.net> | 2021-02-22 18:10:57 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-03-01 10:52:39 +0100 |
commit | 4fa1290c11402f173c39a89324fe45c1b659fd9d (patch) | |
tree | 3de993b6d7e2345f8fafa141f06f66c27e61cb51 /searx/answerers | |
parent | e2fb50089219207f7e11bcfc049b48f2f4b9a6c8 (diff) | |
download | searxng-4fa1290c11402f173c39a89324fe45c1b659fd9d.tar.gz searxng-4fa1290c11402f173c39a89324fe45c1b659fd9d.zip |
[fix] answers: don't crash when the query is an empty string
Diffstat (limited to 'searx/answerers')
-rw-r--r-- | searx/answerers/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/answerers/__init__.py b/searx/answerers/__init__.py index 97e7e5854..8e2b9b35a 100644 --- a/searx/answerers/__init__.py +++ b/searx/answerers/__init__.py @@ -32,7 +32,7 @@ def ask(query): results = [] query_parts = list(filter(None, query.query.split())) - if query_parts[0] not in answerers_by_keywords: + if not query_parts or query_parts[0] not in answerers_by_keywords: return results for answerer in answerers_by_keywords[query_parts[0]]: |