summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2014-12-19 19:40:40 +0100
committerAdam Tauber <asciimoo@gmail.com>2014-12-19 19:40:40 +0100
commit8c05c00762a6c4735763d0590844dfeb80db7227 (patch)
treec2fb102c1b7e3677c94d9d4e1db80bbbb4fb1b80 /searx
parent2b7f3e28e716f74dd8ed1613ee9bd20492daacee (diff)
downloadsearxng-8c05c00762a6c4735763d0590844dfeb80db7227.tar.gz
searxng-8c05c00762a6c4735763d0590844dfeb80db7227.zip
[fix] handle empty search requests
Diffstat (limited to 'searx')
-rw-r--r--searx/search.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/search.py b/searx/search.py
index fd5bfcde5..49d9639dd 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -410,6 +410,7 @@ class Search(object):
# init vars
requests = []
results_queue = Queue()
+ results = {}
suggestions = set()
answers = set()
infoboxes = []
@@ -484,10 +485,11 @@ class Search(object):
# append request to list
requests.append((req, request_params['url'], request_args, selected_engine['name']))
+ if not requests:
+ return results, suggestions, answers, infoboxes
# send all search-request
threaded_requests(requests)
- results = {}
while not results_queue.empty():
engine_name, engine_results = results_queue.get_nowait()