fix: OOB in hasNext of iterator when streaming plots

This commit is contained in:
Pierre Maurice Schwang 2025-02-23 21:37:22 +01:00
parent 9c64c2e5fa
commit 670c241d76
No known key found for this signature in database
GPG Key ID: 37E613079F3E5BB9

View File

@ -44,7 +44,7 @@ interface PlotProvider {
@Override
public boolean hasNext() {
if (currentAreaPlots == null || !currentAreaPlots.hasNext()) {
if (areaIndex >= areas.length) {
if (areaIndex >= areas.length - 1) {
return false;
}
currentAreaPlots = areas[++areaIndex].getPlots().iterator();