prevent NoSuchElementException on PlayerCollection.java

This commit is contained in:
Anthony Calosa
2020-12-01 11:45:54 +08:00
parent 6c9f9a4d6c
commit fa09ce09b8

View File

@@ -47,6 +47,7 @@ public class PlayerCollection extends FCollection<Player> {
// sort functions with Comparator
public Player min(Comparator<Player> comp) {
if (this.isEmpty()) return null;
return Collections.min(this, comp);
}
public Player max(Comparator<Player> comp) {