From fe073bba0b27b6dc9cbafc3adc12789cb28ec066 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sat, 25 Mar 2023 14:00:07 +0400 Subject: [PATCH] Game: fixed NPE on draft auto-pickup on timeout --- Mage/src/main/java/mage/game/draft/DraftImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/game/draft/DraftImpl.java b/Mage/src/main/java/mage/game/draft/DraftImpl.java index add3f5f95a..5976643a3f 100644 --- a/Mage/src/main/java/mage/game/draft/DraftImpl.java +++ b/Mage/src/main/java/mage/game/draft/DraftImpl.java @@ -159,7 +159,9 @@ public abstract class DraftImpl implements Draft { @Override public void autoPick(UUID playerId) { List 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() {