mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
prevent NoSuchElementException on PlayerCollection.java
This commit is contained in:
@@ -47,6 +47,7 @@ public class PlayerCollection extends FCollection<Player> {
|
|||||||
|
|
||||||
// sort functions with Comparator
|
// sort functions with Comparator
|
||||||
public Player min(Comparator<Player> comp) {
|
public Player min(Comparator<Player> comp) {
|
||||||
|
if (this.isEmpty()) return null;
|
||||||
return Collections.min(this, comp);
|
return Collections.min(this, comp);
|
||||||
}
|
}
|
||||||
public Player max(Comparator<Player> comp) {
|
public Player max(Comparator<Player> comp) {
|
||||||
|
|||||||
Reference in New Issue
Block a user