mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- NPE prevention in ControlGainAi.
This commit is contained in:
@@ -227,16 +227,18 @@ public class ControlGainAi extends SpellAbilityAi {
|
||||
t = ComputerUtilCard.getMostExpensivePermanentAI(list, sa, true);
|
||||
}
|
||||
|
||||
if (t.isCreature())
|
||||
creatures--;
|
||||
if (t.isPlaneswalker())
|
||||
planeswalkers--;
|
||||
if (t.isLand())
|
||||
lands--;
|
||||
if (t.isArtifact())
|
||||
artifacts--;
|
||||
if (t.isEnchantment())
|
||||
enchantments--;
|
||||
if (t != null) {
|
||||
if (t.isCreature())
|
||||
creatures--;
|
||||
if (t.isPlaneswalker())
|
||||
planeswalkers--;
|
||||
if (t.isLand())
|
||||
lands--;
|
||||
if (t.isArtifact())
|
||||
artifacts--;
|
||||
if (t.isEnchantment())
|
||||
enchantments--;
|
||||
}
|
||||
|
||||
if (!sa.canTarget(t)) {
|
||||
list.remove(t);
|
||||
|
||||
Reference in New Issue
Block a user