Skip to content

Commit

Permalink
expand sort/searchAfter error checks to catch any invalid case
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdunnjpl committed Jul 9, 2024
1 parent c53e3e0 commit df5bc52
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ public RegistrySearchRequestBuilder paginates(Integer limit, List<String> sort,
this.size(limit);

if ((searchAfter != null) && (!searchAfter.isEmpty())) {
if ((sort == null) || (sort.isEmpty())) {
if (sort == null) {
throw new SortSearchAfterMismatchException("sort argument must be provided if searchAfter argument is provided");
} else if (searchAfter.size() != sort.size()) {
throw new SortSearchAfterMismatchException("sort and searchAfter arguments must be of equal length if provided");
}
this.searchAfter(searchAfter);
}
Expand Down

0 comments on commit df5bc52

Please sign in to comment.