Fixed NPE error

This commit is contained in:
Oleg Agafonov 2019-01-08 11:14:46 +04:00
parent 6c3d813b57
commit 1d8fbb3304
2 changed files with 2 additions and 4 deletions

View file

@ -1,4 +1,3 @@
package mage.cards.a;
import mage.MageObject;
@ -92,8 +91,7 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl {
}
if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) {
Optional<Ability> ability = game.getAbility(event.getTargetId(), event.getSourceId());
return ability != null && ability.isPresent()
&& !(ability.get() instanceof ActivatedManaAbilityImpl);
return ability.isPresent() && !(ability.get() instanceof ActivatedManaAbilityImpl);
}
return false;
}

View file

@ -60,7 +60,7 @@ class KayasWrathEffect extends OneShotEffect {
source.getControllerId(), source.getSourceId(), game
)) {
boolean isMine = permanent != null && permanent.getControllerId().equals(source.getControllerId());
if (permanent.destroy(source.getSourceId(), game, false) && isMine) {
if (isMine && permanent.destroy(source.getSourceId(), game, false)) {
counter++;
}
}