github-api icon indicating copy to clipboard operation
github-api copied to clipboard

NPE on PageIterator.next()

Open goldbal330 opened this issue 3 years ago • 0 comments

Describe the bug NPE sporadically gets thrown by PageIterator (line 74) when PageIterator.hasNext() is invoked.

To Reproduce Steps to reproduce the behavior: I was able to reproduce behavior in this simple jUnit Test:

PageIterator<String> pagedIterator = new PagedIterator<>(((List<String[]>) new ArrayList< String>).iterator(); pagedIterator.hasNext();

It seems like in this corner case currentPage does not get initialized and NPE gets thrown when calling currentPage.length on line 75.

Expected behavior NPE should not be thrown and hasNext() should return false.

Desktop (please complete the following information):

  • OS: [MacOS]
  • Browser [chrome, safari]
  • Version [1.306]

Additional context Add any other context about the problem here.

goldbal330 avatar Aug 11 '22 14:08 goldbal330