From 88eeb2e0e1ad9b8d6901e290f089ca3518ca487d Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 17 Feb 2017 23:49:03 +0100 Subject: [PATCH] * Canopy Cover - FIxed possible null pointer exception (fixes #2874). --- Mage.Sets/src/mage/cards/c/CanopyCover.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CanopyCover.java b/Mage.Sets/src/mage/cards/c/CanopyCover.java index e587d4832d5..39e9d8af7ab 100644 --- a/Mage.Sets/src/mage/cards/c/CanopyCover.java +++ b/Mage.Sets/src/mage/cards/c/CanopyCover.java @@ -59,7 +59,7 @@ public class CanopyCover extends CardImpl { private static final FilterObject filter = new FilterStackObject("spells or abilities your opponents control"); public CanopyCover(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); this.subtype.add("Aura"); // Enchant creature @@ -70,7 +70,7 @@ public class CanopyCover extends CardImpl { this.addAbility(ability); // Enchanted creature can't be blocked except by creatures with flying or reach. (!this is a static ability of the enchantment) - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OrchardSpiritEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanopyCoverEffect())); // Enchanted creature can't be the target of spells or abilities your opponents control. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeTargetedAttachedEffect(filter, Duration.WhileOnBattlefield, AttachmentType.AURA, TargetController.OPPONENT))); @@ -86,14 +86,14 @@ public class CanopyCover extends CardImpl { } } -class OrchardSpiritEffect extends RestrictionEffect { +class CanopyCoverEffect extends RestrictionEffect { - public OrchardSpiritEffect() { + public CanopyCoverEffect() { super(Duration.WhileOnBattlefield); staticText = "Enchanted creature can't be blocked except by creatures with flying or reach"; } - public OrchardSpiritEffect(final OrchardSpiritEffect effect) { + public CanopyCoverEffect(final CanopyCoverEffect effect) { super(effect); } @@ -102,7 +102,7 @@ class OrchardSpiritEffect extends RestrictionEffect { Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null && equipment.getAttachedTo() != null) { Permanent equipped = game.getPermanent(equipment.getAttachedTo()); - if (permanent.getId().equals(equipped.getId())) { + if (equipped != null && permanent.getId().equals(equipped.getId())) { return true; } } @@ -115,7 +115,7 @@ class OrchardSpiritEffect extends RestrictionEffect { } @Override - public OrchardSpiritEffect copy() { - return new OrchardSpiritEffect(this); + public CanopyCoverEffect copy() { + return new CanopyCoverEffect(this); } }