mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-30 14:43:54 +01:00
Fix getBukkitEntity() for nulls
This commit is contained in:
parent
dd58a07528
commit
7c45b167c0
@ -90,7 +90,7 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Entity entity = entityController.getBukkitEntity();
|
Entity entity = entityController.getBukkitEntity();
|
||||||
if (entity instanceof LivingEntity) {
|
if (entity == null || entity instanceof LivingEntity) {
|
||||||
return (LivingEntity) entity;
|
return (LivingEntity) entity;
|
||||||
}
|
}
|
||||||
throw new IllegalStateException("getBukkitEntity() called on a non-living NPC");
|
throw new IllegalStateException("getBukkitEntity() called on a non-living NPC");
|
||||||
|
Loading…
Reference in New Issue
Block a user