- Fixed possible NPE caused by Balance effects.

This commit is contained in:
Sloth
2015-04-28 18:33:46 +00:00
parent 41fdcc9b50
commit d82c71bb98

View File

@@ -578,7 +578,7 @@ public class ComputerUtil {
}
}
Card c;
Card c = null;
if (CardLists.getNotType(remaining, "Creature").isEmpty()) {
c = ComputerUtilCard.getWorstCreatureAI(remaining);
}
@@ -589,7 +589,7 @@ public class ComputerUtil {
c = ComputerUtilCard.getWorstPermanentAI(remaining, false, false, false, false);
}
if (c.isEnchanted()) {
if (c != null && c.isEnchanted()) {
// TODO: choose "worst" controlled enchanting Aura
for (Card aura : c.getEnchantedBy(false)) {
if (aura.getController().equals(c.getController()) && remaining.contains(aura)) {