From 763fdbd6f7b89bce81e1a57dca6f1a25d40a496c Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 17 Apr 2021 12:48:57 -0400 Subject: [PATCH] [STX] added null check to Selfless Glyphweaver --- .../src/mage/cards/s/SelflessGlyphweaver.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/cards/s/SelflessGlyphweaver.java b/Mage.Sets/src/mage/cards/s/SelflessGlyphweaver.java index f4650b23a9..51dfff39c2 100644 --- a/Mage.Sets/src/mage/cards/s/SelflessGlyphweaver.java +++ b/Mage.Sets/src/mage/cards/s/SelflessGlyphweaver.java @@ -26,14 +26,17 @@ import mage.target.common.TargetCreatureOrPlaneswalker; import java.util.UUID; /** - * * @author htrajan */ public final class SelflessGlyphweaver extends ModalDoubleFacesCard { public SelflessGlyphweaver(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, new SubType[]{SubType.HUMAN, SubType.CLERIC}, "{2}{W}", - "Deadly Vanity", new CardType[]{CardType.SORCERY}, new SubType[]{}, "{5}{B}{B}{B}"); + super( + ownerId, setInfo, + new CardType[]{CardType.CREATURE}, new SubType[]{SubType.HUMAN, SubType.CLERIC}, "{2}{W}", + "Deadly Vanity", + new CardType[]{CardType.SORCERY}, new SubType[]{}, "{5}{B}{B}{B}" + ); // 1. // Selfless Glyphweaver @@ -73,10 +76,12 @@ class DeadlyVanityEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } TargetPermanent target = new TargetCreatureOrPlaneswalker(); target.setNotTarget(true); - - Player controller = game.getPlayer(source.getControllerId()); controller.choose(outcome, target, source.getId(), game); FilterPermanent filter = new FilterCreatureOrPlaneswalkerPermanent(); @@ -91,4 +96,4 @@ class DeadlyVanityEffect extends OneShotEffect { public DeadlyVanityEffect copy() { return new DeadlyVanityEffect(this); } -} \ No newline at end of file +}