- Fix for getCardState causing an NPE when tokens cease to exist

This commit is contained in:
jendave
2011-08-06 17:04:25 +00:00
parent b7b3403398
commit 0f0bae08eb

View File

@@ -413,9 +413,12 @@ public class AllZoneUtil {
} }
public static Card getCardState(Card card){ public static Card getCardState(Card card){
CardList zone = getCardsInZone(AllZone.getZone(card).getZoneName()); PlayerZone zone = AllZone.getZone(card);
if (zone == null) // for tokens
return null;
for(Card c : zone){ CardList list = getCardsInZone(zone.getZoneName());
for(Card c : list){
if (card.equals(c)) if (card.equals(c))
return c; return c;
} }