Unverified Commit 69c15a39 authored by Gautier de Saint Martin Lacaze's avatar Gautier de Saint Martin Lacaze Committed by GitHub
Browse files

Merge pull request #713 from gitlab4j/issue-658

Fix #658 : Pager not working properly
parents db8f9254 4e9f7a6c
......@@ -306,12 +306,6 @@ public class Pager<T> implements Iterator<List<T>>, Constants {
*/
public List<T> page(int pageNumber) {
if (pageNumber > totalPages && pageNumber > kaminariNextPage) {
throw new NoSuchElementException();
} else if (pageNumber < 1) {
throw new NoSuchElementException();
}
if (currentPage == 0 && pageNumber == 1) {
currentPage = 1;
return (currentItems);
......@@ -321,6 +315,12 @@ public class Pager<T> implements Iterator<List<T>>, Constants {
return (currentItems);
}
if (pageNumber > totalPages && pageNumber > kaminariNextPage) {
throw new NoSuchElementException();
} else if (pageNumber < 1) {
throw new NoSuchElementException();
}
try {
setPageParam(pageNumber);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment