*If, for some reason, a ChangeZone ability is passed zero targets (if, say, a Faceless Devourer enters play without targeting anything) there will no longer be an NPE. Fixes the Faceless creatures, Oblivion Ring,Journey to Nowhere etc.

This commit is contained in:
jendave
2011-08-06 16:34:34 +00:00
parent 27d4596c0c
commit 06823e0007

View File

@@ -827,8 +827,11 @@ public class AbilityFactory_ChangeZone {
tgtCards.add(c); tgtCards.add(c);
} }
} }
Card targetCard = null;
if(tgtCards.size() != 0)
{
Card targetCard = tgtCards.get(0); targetCard = tgtCards.get(0);
for(Card tgtC : tgtCards){ for(Card tgtC : tgtCards){
PlayerZone originZone = AllZone.getZone(tgtC); PlayerZone originZone = AllZone.getZone(tgtC);
@@ -870,7 +873,7 @@ public class AbilityFactory_ChangeZone {
} }
} }
} }
}
if (af.hasSubAbility()){ if (af.hasSubAbility()){
Ability_Sub abSub = sa.getSubAbility(); Ability_Sub abSub = sa.getSubAbility();