The Gitrog Monster - Fixed possible null pointer exception.

This commit is contained in:
LevelX2 2016-04-07 22:34:20 +02:00
parent 94d216956c
commit 24faec3d12
3 changed files with 72 additions and 7 deletions

View file

@ -25,19 +25,18 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterBasicLandCard;
import mage.target.common.TargetCardInLibrary;
@ -50,6 +49,8 @@ public class EvolvingWilds extends CardImpl {
public EvolvingWilds(UUID ownerId) {
super(ownerId, 228, "Evolving Wilds", Rarity.COMMON, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "ROE";
// {T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.
this.addAbility(new EvolvingWildsAbility());
}

View file

@ -107,11 +107,11 @@ class TheGitrogMonsterTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
if (Zone.GRAVEYARD == zEvent.getToZone()) {
if (Zone.GRAVEYARD == zEvent.getToZone() && zEvent.getCards() != null) {
for (Card card : zEvent.getCards()) {
UUID cardOwnerId = card.getOwnerId();
List<CardType> cardType = card.getCardType();
if(cardOwnerId != null
if (cardOwnerId != null
&& card.getOwnerId().equals(getControllerId())
&& cardType != null
&& cardType.contains(CardType.LAND)) {