* Konda's Banner - Fix NullPointerException when equipped creature is destroyed

This commit is contained in:
Quercitron 2015-11-26 01:44:19 +03:00
parent 69d3bc0575
commit 7839bd89cb

View file

@ -154,14 +154,16 @@ class KondasBannerColorBoostEffect extends BoostAllEffect {
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
Permanent equipedCreature = game.getPermanent(equipment.getAttachedTo());
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if (equipedCreature.getColor(game).shares(perm.getColor(game))) {
perm.addPower(power.calculate(game, source, this));
perm.addToughness(toughness.calculate(game, source, this));
if (equipedCreature != null) {
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if (equipedCreature.getColor(game).shares(perm.getColor(game))) {
perm.addPower(power.calculate(game, source, this));
perm.addToughness(toughness.calculate(game, source, this));
}
}
return true;
}
return true;
}
return false;
}