mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21:18:58 +00:00
(index-client) Fix error when zero results are found
This commit is contained in:
parent
95cde242ca
commit
336d6fdd14
@ -83,7 +83,7 @@ public class IndexClient {
|
|||||||
int indexEnd = (pagination.page) * pagination.pageSize;
|
int indexEnd = (pagination.page) * pagination.pageSize;
|
||||||
|
|
||||||
results = results.subList(
|
results = results.subList(
|
||||||
clamp(indexStart, 0, results.size() - 1), // from is inclusive, so subtract 1 from size()
|
clamp(indexStart, 0, Math.max(0, results.size() - 1)), // from is inclusive, so subtract 1 from size()
|
||||||
clamp(indexEnd, 0, results.size()));
|
clamp(indexEnd, 0, results.size()));
|
||||||
|
|
||||||
return new AggregateQueryResponse(results, pagination.page(), numReceivedResults);
|
return new AggregateQueryResponse(results, pagination.page(), numReceivedResults);
|
||||||
|
Loading…
Reference in New Issue
Block a user