[CLB] Undercity Dungeon - fixed game error (NPE fix)

This commit is contained in:
Oleg Agafonov 2023-04-19 18:34:52 +04:00
parent 491fc560e8
commit c061c7f436

View file

@ -159,9 +159,11 @@ class ThroneOfTheDeadThreeEffect extends OneShotEffect {
if (card != null) {
player.moveCards(card, Zone.BATTLEFIELD, source, game);
Permanent permanent = game.getPermanent(card.getId());
permanent.addCounters(CounterType.P1P1.createInstance(3), source, game);
game.addEffect(new GainAbilityTargetEffect(HexproofAbility.getInstance(), Duration.UntilYourNextTurn)
.setTargetPointer(new FixedTarget(permanent, game)), source);
if (permanent != null) {
permanent.addCounters(CounterType.P1P1.createInstance(3), source, game);
game.addEffect(new GainAbilityTargetEffect(HexproofAbility.getInstance(), Duration.UntilYourNextTurn)
.setTargetPointer(new FixedTarget(permanent, game)), source);
}
}
player.shuffleLibrary(source, game);
return true;