* Abeyance - Fixed possible null pointer exception.
*/
package mage.cards.a;
+import java.util.Optional;
+import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
@@ -41,9 +43,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.TargetPlayer;
-import java.util.Optional;
-import java.util.UUID;
-
/**
*
* @author fireshoes
@@ -103,7 +102,7 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
- if (event.getPlayerId().equals(source.getFirstTarget())) {
+ if (source.getFirstTarget() != null && source.getFirstTarget().equals(event.getPlayerId())) {
MageObject object = game.getObject(event.getSourceId());
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
if (object.isInstant() || object.isSorcery()) {
