Fix NullRef in TokenAi - one of the checks assumes the token is a creature which causes a NullRef on Clue Tokens. Added null checks.

Fix for "SubAbility not found for: Liliana's Indignation (109)"
This commit is contained in:
jje4th
2016-04-07 04:36:36 +00:00
parent 0482129cf3
commit 3171f0d3a9
2 changed files with 2 additions and 2 deletions

View File

@@ -250,7 +250,7 @@ public class TokenAi extends SpellAbilityAi {
}
}
if (this.tokenAmount.equals("X") || this.tokenPower.equals("X") || this.tokenToughness.equals("X")) {
if (this.tokenAmount.equals("X") || (this.tokenPower != null && this.tokenPower.equals("X")) || (this.tokenToughness != null && this.tokenToughness.equals("X"))) {
int x = AbilityUtils.calculateAmount(sa.getHostCard(), this.tokenAmount, sa);
if (source.getSVar("X").equals("Count$Converge")) {
x = ComputerUtilMana.getConvergeCount(sa, ai);