mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Fixed NPE if non tournament player submits a deck.
This commit is contained in:
parent
57bec7a0c1
commit
a7a023b5c1
1 changed files with 12 additions and 3 deletions
|
@ -217,9 +217,18 @@ public class TableController {
|
|||
|
||||
public synchronized boolean submitDeck(UUID userId, DeckCardLists deckList) throws MageException {
|
||||
UUID playerId = userPlayerMap.get(userId);
|
||||
TournamentPlayer player = tournament.getPlayer(playerId);
|
||||
if (player.hasQuit()) {
|
||||
return true; // so the construct panel closes after submit
|
||||
if (table.isTournament()) {
|
||||
TournamentPlayer player = tournament.getPlayer(playerId);
|
||||
if (player.hasQuit()) {
|
||||
return true; // so the construct panel closes after submit
|
||||
}
|
||||
} else {
|
||||
if (table.getMatch() != null) {
|
||||
MatchPlayer mPlayer = table.getMatch().getPlayer(playerId);
|
||||
if (mPlayer.hasQuit()) {
|
||||
return true; // so the construct panel closes after submit
|
||||
}
|
||||
}
|
||||
}
|
||||
if (table.getState() != TableState.SIDEBOARDING && table.getState() != TableState.CONSTRUCTING) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue