Fixed NPE if non tournament player submits a deck.

This commit is contained in:
LevelX2 2013-07-19 19:14:33 +02:00
parent 57bec7a0c1
commit a7a023b5c1

View file

@ -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;