From 4fa1290c11402f173c39a89324fe45c1b659fd9d Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Mon, 22 Feb 2021 18:10:57 +0100 Subject: [PATCH] [fix] answers: don't crash when the query is an empty string --- searx/answerers/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]]: