mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Fixed NPE error in drafting and disconnected player
This commit is contained in:
parent
6a9a4c78ca
commit
30389e426f
1 changed files with 5 additions and 3 deletions
|
|
@ -158,11 +158,13 @@ public abstract class DraftImpl implements Draft {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void autoPick(UUID playerId) {
|
public void autoPick(UUID playerId) {
|
||||||
|
if (players.containsKey(playerId)) {
|
||||||
List<Card> booster = players.get(playerId).getBooster();
|
List<Card> booster = players.get(playerId).getBooster();
|
||||||
if (booster.size() > 0) {
|
if (booster.size() > 0) {
|
||||||
this.addPick(playerId, booster.get(booster.size() - 1).getId(), null);
|
this.addPick(playerId, booster.get(booster.size() - 1).getId(), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void passBoosterToLeft() {
|
protected void passBoosterToLeft() {
|
||||||
synchronized (players) {
|
synchronized (players) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue