Added additional fixes for getSpellAbility() usage, related to ce3cf742c9

This commit is contained in:
Oleg Agafonov 2023-06-11 11:26:34 +04:00
parent ce3cf742c9
commit 499f21778d
4 changed files with 4 additions and 4 deletions

View file

@ -80,7 +80,7 @@ class GhastlyConscriptionEffect extends OneShotEffect {
for (Card card : cardsToManifest) {
ManaCosts manaCosts = null;
if (card.isCreature(game)) {
manaCosts = card.getSpellAbility().getManaCosts();
manaCosts = card.getSpellAbility() != null ? card.getSpellAbility().getManaCosts() : null;
if (manaCosts == null) {
manaCosts = new ManaCostsImpl<>("{0}");
}

View file

@ -65,7 +65,7 @@ class IceCaveEffect extends OneShotEffect {
Spell spell = (Spell) game.getStack().getStackObject(targetPointer.getFirst(game, source));
if (sourcePermanent != null && spell != null && controller != null) {
Player spellController = game.getPlayer(spell.getControllerId());
Cost cost = new ManaCostsImpl<>(spell.getSpellAbility().getManaCosts().getText());
Cost cost = new ManaCostsImpl<>(spell.getSpellAbility() == null ? "" : spell.getSpellAbility().getManaCosts().getText());
if (spellController != null) {
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);

View file

@ -100,7 +100,7 @@ class JeskaiInfiltratorEffect extends OneShotEffect {
exileZone.getCards(game).forEach(card -> {
ManaCosts manaCosts = null;
if (card.isCreature(game)) {
manaCosts = card.getSpellAbility().getManaCosts();
manaCosts = card.getSpellAbility() != null ? card.getSpellAbility().getManaCosts() : null;
if (manaCosts == null) {
manaCosts = new ManaCostsImpl<>("{0}");
}

View file

@ -56,7 +56,7 @@ public class ManifestTargetPlayerEffect extends OneShotEffect {
for (Card card : cards) {
ManaCosts manaCosts = null;
if (card.isCreature(game)) {
manaCosts = card.getSpellAbility().getManaCosts();
manaCosts = card.getSpellAbility() != null ? card.getSpellAbility().getManaCosts() : null;
if (manaCosts == null) {
manaCosts = new ManaCostsImpl<>("{0}");
}