Game: fixed NPE on draft auto-pickup on timeout

This commit is contained in:
Oleg Agafonov 2023-03-25 14:00:07 +04:00
parent 66d0ef4b35
commit fe073bba0b

View file

@ -159,7 +159,9 @@ public abstract class DraftImpl implements Draft {
@Override
public void autoPick(UUID playerId) {
List<Card> booster = players.get(playerId).getBooster();
this.addPick(playerId, booster.get(booster.size()-1).getId(), null);
if (booster.size() > 0) {
this.addPick(playerId, booster.get(booster.size() - 1).getId(), null);
}
}
protected void passBoosterToLeft() {