Fixed NPE error in drafting and disconnected player

This commit is contained in:
Oleg Agafonov 2023-05-09 16:17:04 +04:00
parent 6a9a4c78ca
commit 30389e426f

View file

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