mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
* Time to Reflect - Fixed possible null pointer exception.
This commit is contained in:
parent
91342cc350
commit
d7671bf0b1
1 changed files with 5 additions and 1 deletions
|
@ -45,6 +45,7 @@ import mage.filter.predicate.Predicates;
|
|||
import mage.filter.predicate.permanent.PermanentIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.watchers.Watcher;
|
||||
|
@ -73,7 +74,10 @@ public class TimeToReflect extends CardImpl {
|
|||
BlockedOrWasBlockedByAZombieWatcher watcher = (BlockedOrWasBlockedByAZombieWatcher) game.getState().getWatchers().get("BlockedOrWasBlockedByAZombieWatcher");
|
||||
if (watcher != null) {
|
||||
for (MageObjectReference mor : watcher.getBlockedThisTurnCreatures()) {
|
||||
creaturesThatBlockedOrWereBlockedByAZombie.add(new PermanentIdPredicate(mor.getPermanent(game).getId()));
|
||||
Permanent permanent = mor.getPermanent(game);
|
||||
if (permanent != null) {
|
||||
creaturesThatBlockedOrWereBlockedByAZombie.add(new PermanentIdPredicate(permanent.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
filter.add(Predicates.or(creaturesThatBlockedOrWereBlockedByAZombie));
|
||||
|
|
Loading…
Reference in a new issue