From 3b2ca119dba0ebef2f41e8787b7a31f6f0ea0df0 Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Wed, 20 Oct 2021 00:06:56 +0200 Subject: [PATCH] Fix NPE when moving commander created by ApiBased SA (e.g. Hogaak) --- forge-game/src/main/java/forge/game/GameAction.java | 2 +- forge-game/src/main/java/forge/game/ability/AbilityFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/forge-game/src/main/java/forge/game/GameAction.java b/forge-game/src/main/java/forge/game/GameAction.java index 31b57f679d4..4e873a7604d 100644 --- a/forge-game/src/main/java/forge/game/GameAction.java +++ b/forge-game/src/main/java/forge/game/GameAction.java @@ -1508,7 +1508,7 @@ public class GameAction { c.getGame().getTracker().flush(); c.setMoveToCommandZone(false); - if (c.getOwner().getController().confirmAction(c.getSpellPermanent(), PlayerActionConfirmMode.ChangeZoneToAltDestination, c.getName() + ": If a commander is in a graveyard or in exile and that card was put into that zone since the last time state-based actions were checked, its owner may put it into the command zone.")) { + if (c.getOwner().getController().confirmAction(c.getFirstSpellAbility(), PlayerActionConfirmMode.ChangeZoneToAltDestination, c.getName() + ": If a commander is in a graveyard or in exile and that card was put into that zone since the last time state-based actions were checked, its owner may put it into the command zone.")) { moveTo(c.getOwner().getZone(ZoneType.Command), c, null); return true; } diff --git a/forge-game/src/main/java/forge/game/ability/AbilityFactory.java b/forge-game/src/main/java/forge/game/ability/AbilityFactory.java index 09d163e8094..26907d37024 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityFactory.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityFactory.java @@ -216,7 +216,7 @@ public final class AbilityFactory { else if (api == ApiType.PermanentCreature || api == ApiType.PermanentNoncreature) { // If API is a permanent type, and creating AF Spell - // Clear out the auto created SpellPemanent spell + // Clear out the auto created SpellPermanent spell if (type == AbilityRecordType.Spell && !mapParams.containsKey("SubAbility") && !mapParams.containsKey("NonBasicSpell")) { hostCard.clearFirstSpell();