Skip to content

Commit

Permalink
Fixed an infinite loop (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachesMLG authored Aug 2, 2021
1 parent 1aed4b7 commit 95f91e7
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ public List<T> getEntries(@NotNull Island island) {
while (true) {
if (currentIndex < 0) break;
IslandData islandData = getEntries().get(currentIndex);
if (islandData == null) continue;
if (islandData == null) {
currentIndex--;
continue;
}
if (island.equals(islandData.getIsland().orElse(null))) {
result.add(getEntries().get(currentIndex));
currentIndex--;
Expand All @@ -64,7 +67,10 @@ public List<T> getEntries(@NotNull Island island) {
while (true) {
if (currentIndex >= getEntries().size()) break;
IslandData islandData = getEntries().get(currentIndex);
if (islandData == null) continue;
if (islandData == null) {
currentIndex++;
continue;
}
if (island.equals(islandData.getIsland().orElse(null))) {
result.add(getEntries().get(currentIndex));
currentIndex++;
Expand Down

0 comments on commit 95f91e7

Please sign in to comment.