github-api
github-api copied to clipboard
NPE on PageIterator.next()
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.