From 14ac6609db05d3d564885ef03524f94e3196931a Mon Sep 17 00:00:00 2001 From: Ingmar Goudt Date: Sun, 13 Jan 2019 12:06:09 +0100 Subject: [PATCH] fix classcast exception in GuardianProject --- Mage.Sets/src/mage/cards/g/GuardianProject.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/g/GuardianProject.java b/Mage.Sets/src/mage/cards/g/GuardianProject.java index e58e833913..fe7ac3aa84 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianProject.java +++ b/Mage.Sets/src/mage/cards/g/GuardianProject.java @@ -19,6 +19,7 @@ import mage.filter.predicate.other.OwnerIdPredicate; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.filter.predicate.permanent.TokenPredicate; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; @@ -71,7 +72,7 @@ class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbili @Override public boolean checkTrigger(GameEvent event, Game game) { - Permanent permanent = ((ZoneChangeEvent) event).getTarget(); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (!filter.match(permanent, sourceId, controllerId, game)) { return false; } @@ -97,7 +98,7 @@ class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbili if (player == null) { return false; } - if (!permanent.getName().equals("")) { + if (!permanent.getName().isEmpty()) { FilterCard filterCard = new FilterCard(); filterCard.add(new NamePredicate(permanent.getName())); filterCard.add(new OwnerIdPredicate(controllerId));