forked from Ponysearch/Ponysearch
[fix] answers: don't crash when the query is an empty string
This commit is contained in:
parent
e2fb500892
commit
4fa1290c11
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue