* Fixed some possible null pointer exceptions.

This commit is contained in:
LevelX2 2016-09-20 23:40:25 +02:00
parent ab352100f1
commit c82d6b5566
6 changed files with 171 additions and 160 deletions

View file

@ -996,6 +996,10 @@ public abstract class PlayerImpl implements Player, Serializable {
Zone fromZone = game.getState().getZone(card.getMainCard().getId());
card.cast(game, fromZone, ability, playerId);
Spell spell = game.getStack().getSpell(ability.getId());
if (spell == null) {
logger.error("Got no spell from stack. ability: " + ability.getRule());
return false;
}
// some effects set sourceId to cast without paying mana costs or other costs
if (ability.getSourceId().equals(getCastSourceIdWithAlternateMana())) {
Ability spellAbility = spell.getSpellAbility();