1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 12:10:11 +01:00

[fix] answers: don't crash when the query is an empty string

This commit is contained in:
Alexandre Flament 2021-02-22 18:10:57 +01:00
parent e2fb500892
commit 4fa1290c11

View File

@ -32,7 +32,7 @@ def ask(query):
results = [] results = []
query_parts = list(filter(None, query.query.split())) 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 return results
for answerer in answerers_by_keywords[query_parts[0]]: for answerer in answerers_by_keywords[query_parts[0]]: