mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 13:09:00 +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;
|
||||
|
||||
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()));
|
||||
|
||||
return new AggregateQueryResponse(results, pagination.page(), numReceivedResults);
|
||||
|
Loading…
Reference in New Issue
Block a user