mirror of https://github.com/searxng/searxng.git
[fix] answers: don't crash when the query is an empty string
This commit is contained in:
parent
e2fb500892
commit
4fa1290c11
|
@ -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]]:
|
||||
|
|
Loading…
Reference in New Issue