1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-13 01:09:53 -09:00

Fixed a problem of DiesTriggeredAbility that produced null pointer exception.

This commit is contained in:
LevelX2 2017-07-31 20:42:32 +02:00
parent 8b880bfd47
commit 7a1245e2fe
2 changed files with 60 additions and 56 deletions
Mage/src/main/java/mage/abilities

View file

@ -64,7 +64,7 @@ public class DiesTriggeredAbility extends ZoneChangeTriggeredAbility {
return false;
}
// check now it is in graveyard
if (before.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(source.getId())) {
if (before.getZoneChangeCounter(game) + 1 == game.getState().getZoneChangeCounter(sourceId)) {
Zone after = game.getState().getZone(sourceId);
return after != null && Zone.GRAVEYARD.match(after);
} else {

View file

@ -49,7 +49,11 @@ public class BoostAllOfChosenSubtypeEffect extends BoostAllEffect {
@Override
protected void setRuntimeData(Ability source, Game game) {
String s = (String) game.getState().getValue(source.getSourceId() + "_type");
if (subtype != null) {
subtype = SubType.byDescription(s);
} else {
discard();
}
}
}