From d9f846f78310b248f9b7dfcb4498ba4d1e053899 Mon Sep 17 00:00:00 2001
From: magenoxx <magenoxx@gmail>
Date: Wed, 14 Sep 2011 12:50:29 +0400
Subject: [PATCH] Fixed NPE in SetCardSubtypeAttachedEffect

---
 .../common/continious/SetCardSubtypeAttachedEffect.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Mage/src/mage/abilities/effects/common/continious/SetCardSubtypeAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continious/SetCardSubtypeAttachedEffect.java
index 1eb7aa681d..28485e37c7 100644
--- a/Mage/src/mage/abilities/effects/common/continious/SetCardSubtypeAttachedEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continious/SetCardSubtypeAttachedEffect.java
@@ -59,8 +59,10 @@ public class SetCardSubtypeAttachedEffect extends ContinuousEffectImpl<SetCardSu
         Permanent equipment = game.getPermanent(source.getSourceId());
         if (equipment != null && equipment.getAttachedTo() != null) {
             Permanent target = game.getPermanent(equipment.getAttachedTo());
-			target.getSubtype().clear();
-			target.getSubtype().add(setSubtype);
+			if (target != null) {
+				target.getSubtype().clear();
+				target.getSubtype().add(setSubtype);
+			}
         }
         return true;
     }