* Canopy Cover - FIxed possible null pointer exception (fixes
@@ -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);
}
}
