Merge pull request #1821 from drmDev/master

another ZoneGroupChangeEvent NPE fix - Sidisi
This commit is contained in:
Derek M 2016-04-08 00:25:01 -04:00
commit cdb37813ca

View file

@ -27,6 +27,7 @@
*/
package mage.sets.khansoftarkir;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
@ -127,12 +128,22 @@ class SidisiBroodTyrantTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
if (Zone.LIBRARY == zEvent.getFromZone() && Zone.GRAVEYARD == zEvent.getToZone()) {
if (zEvent != null && Zone.LIBRARY == zEvent.getFromZone() && Zone.GRAVEYARD == zEvent.getToZone() && zEvent.getCards() != null) {
for (Card card : zEvent.getCards()) {
if (card.getOwnerId().equals(getControllerId()) && card.getCardType().contains(CardType.CREATURE)) {
if (card != null) {
UUID cardOwnerId = card.getOwnerId();
List<CardType> cardType = card.getCardType();
if (cardOwnerId != null
&& card.getOwnerId().equals(getControllerId())
&& cardType != null
&& card.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
}
}
return false;
}