From 05826fa8d8a8e60a99d88a1ca36f1c693e1043b7 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 9 Jun 2023 07:01:45 +0400 Subject: [PATCH] RevealAndSeparatePilesEffect - fixed NPE --- .../effects/common/RevealAndSeparatePilesEffect.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/abilities/effects/common/RevealAndSeparatePilesEffect.java b/Mage/src/main/java/mage/abilities/effects/common/RevealAndSeparatePilesEffect.java index 35f6d73209..e2e8c98431 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/RevealAndSeparatePilesEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/RevealAndSeparatePilesEffect.java @@ -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()); - game.informPlayers(controller.getLogName() + " chose " + opponent.getLogName() + " to " + message); + if (opponent != null) { + game.informPlayers(controller.getLogName() + " chose " + opponent.getLogName() + " to " + message); + } else { + game.informPlayers(controller.getLogName() + " chose nothing" + " to " + message); + } } return opponent; }