mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +00:00
another ZoneGroupChangeEvent NPE fix - Sidisi
This commit is contained in:
parent
e57f5cc12f
commit
e1f145ab19
1 changed files with 14 additions and 3 deletions
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.khansoftarkir;
|
package mage.sets.khansoftarkir;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
@ -127,11 +128,21 @@ class SidisiBroodTyrantTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
|
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()) {
|
for (Card card : zEvent.getCards()) {
|
||||||
if (card.getOwnerId().equals(getControllerId()) && card.getCardType().contains(CardType.CREATURE)) {
|
if (card != null) {
|
||||||
return true;
|
|
||||||
|
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;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue