Fixed some exception problems.

This commit is contained in:
LevelX2 2018-01-27 18:29:47 +01:00
parent 84a815eb73
commit c401a7f5ea

View file

@ -224,7 +224,7 @@ public abstract class MatchImpl implements Match {
addGame(); // raises only the number
shufflePlayers();
for (MatchPlayer matchPlayer : this.players) {
if (!matchPlayer.hasQuit()) {
if (!matchPlayer.hasQuit() && matchPlayer.getDeck() != null) {
matchPlayer.getPlayer().init(game);
game.loadCards(matchPlayer.getDeck().getCards(), matchPlayer.getPlayer().getId());
game.loadCards(matchPlayer.getDeck().getSideboard(), matchPlayer.getPlayer().getId());
@ -237,6 +237,10 @@ public abstract class MatchImpl implements Match {
matchPlayer.getPlayer().setPriorityTimeLeft(matchPlayer.getPriorityTimeLeft());
}
}
} else {
if (matchPlayer.getDeck() == null) {
logger.error("Match: " + this.getId() + " " + matchPlayer.getName() + " has no deck.");
}
}
}
game.setPriorityTime(options.getPriorityTime());