diff --git a/app/corpora/cqi/models/subcorpora.py b/app/corpora/cqi/models/subcorpora.py index b39f7554..5024d20b 100644 --- a/app/corpora/cqi/models/subcorpora.py +++ b/app/corpora/cqi/models/subcorpora.py @@ -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 = []