Skip to content
Snippets Groups Projects
Commit 94e71b41 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

fix empty matches error

parent e99053e3
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,8 @@ class Subcorpus:
def dump_values(self, context=25, first_result=0,
num_results=float('inf')):
if self.size == 0:
return {"matches": []}
first_result = max(0, first_result)
last_result = min((first_result + num_results - 1), (self.size - 1))
matches = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment