File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/java/org/gitlab4j/api Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -306,12 +306,6 @@ public List<T> current() throws GitLabApiException {
306306 */
307307 public List <T > page (int pageNumber ) {
308308
309- if (pageNumber > totalPages && pageNumber > kaminariNextPage ) {
310- throw new NoSuchElementException ();
311- } else if (pageNumber < 1 ) {
312- throw new NoSuchElementException ();
313- }
314-
315309 if (currentPage == 0 && pageNumber == 1 ) {
316310 currentPage = 1 ;
317311 return (currentItems );
@@ -321,6 +315,12 @@ public List<T> page(int pageNumber) {
321315 return (currentItems );
322316 }
323317
318+ if (pageNumber > totalPages && pageNumber > kaminariNextPage ) {
319+ throw new NoSuchElementException ();
320+ } else if (pageNumber < 1 ) {
321+ throw new NoSuchElementException ();
322+ }
323+
324324 try {
325325
326326 setPageParam (pageNumber );
You can’t perform that action at this time.
0 commit comments