Skip to content

Commit

Permalink
Fix null-pointer issue when trying to get first element of empty list.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Feb 19, 2019
1 parent 4c762dd commit 5e2d3f9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ private void savePlayerData(@NonNull String uniqueID)

Iterator<LogEntry> entryIterator = cachedData.getHistory().iterator();

while (this.shouldBeRemoved(entryIterator.next(), survivalTime))
while (entryIterator.hasNext() && this.shouldBeRemoved(entryIterator.next(), survivalTime))
{
entryIterator.remove();
}
Expand Down

0 comments on commit 5e2d3f9

Please sign in to comment.