Fix getBukkitEntity() for nulls

This commit is contained in:
fullwall 2013-11-06 00:58:20 +08:00
parent dd58a07528
commit 7c45b167c0

View File

@ -90,7 +90,7 @@ public class CitizensNPC extends AbstractNPC {
return null;
}
Entity entity = entityController.getBukkitEntity();
if (entity instanceof LivingEntity) {
if (entity == null || entity instanceof LivingEntity) {
return (LivingEntity) entity;
}
throw new IllegalStateException("getBukkitEntity() called on a non-living NPC");