From 0587b68db4ef9216b5101b9ddf222cb93fa41816 Mon Sep 17 00:00:00 2001 From: fullwall Date: Mon, 3 Sep 2012 15:40:40 +0800 Subject: [PATCH] Allow null in CitizensNPCRegistry#getNPC(Entity) --- src/main/java/net/citizensnpcs/npc/CitizensNPCRegistry.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/CitizensNPCRegistry.java b/src/main/java/net/citizensnpcs/npc/CitizensNPCRegistry.java index fdd9afe65..66890c70e 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensNPCRegistry.java +++ b/src/main/java/net/citizensnpcs/npc/CitizensNPCRegistry.java @@ -37,7 +37,6 @@ import net.citizensnpcs.npc.entity.CitizensZombieNPC; import net.citizensnpcs.util.ByIdArray; import net.citizensnpcs.util.Messaging; -import org.apache.commons.lang.Validate; import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; @@ -140,7 +139,8 @@ public class CitizensNPCRegistry implements NPCRegistry { @Override public NPC getNPC(Entity entity) { - Validate.notNull(entity); + if (entity == null) + return null; net.minecraft.server.Entity handle = ((CraftEntity) entity).getHandle(); return handle instanceof NPCHolder ? ((NPCHolder) handle).getNPC() : null; }