summaryrefslogtreecommitdiff
path: root/searx/answerers
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-02-22 18:10:57 +0100
committerAlexandre Flament <alex@al-f.net>2021-03-01 10:52:39 +0100
commit4fa1290c11402f173c39a89324fe45c1b659fd9d (patch)
tree3de993b6d7e2345f8fafa141f06f66c27e61cb51 /searx/answerers
parente2fb50089219207f7e11bcfc049b48f2f4b9a6c8 (diff)
downloadsearxng-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__.py2
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]]: