RevealAndSeparatePilesEffect - fixed NPE

This commit is contained in:
Oleg Agafonov 2023-06-09 07:01:45 +04:00
parent 49ce794c45
commit 05826fa8d8

View file

@ -92,7 +92,11 @@ public class RevealAndSeparatePilesEffect extends OneShotEffect {
Target targetOpponent = new TargetOpponent(true);
controller.chooseTarget(Outcome.Neutral, targetOpponent, source, game);
opponent = game.getPlayer(targetOpponent.getFirstTarget());
if (opponent != null) {
game.informPlayers(controller.getLogName() + " chose " + opponent.getLogName() + " to " + message);
} else {
game.informPlayers(controller.getLogName() + " chose nothing" + " to " + message);
}
}
return opponent;
}