diff --git a/main/src/main/java/net/citizensnpcs/ProtocolLibListener.java b/main/src/main/java/net/citizensnpcs/ProtocolLibListener.java index 1af7c1eee..c6e0c001c 100644 --- a/main/src/main/java/net/citizensnpcs/ProtocolLibListener.java +++ b/main/src/main/java/net/citizensnpcs/ProtocolLibListener.java @@ -250,9 +250,9 @@ public class ProtocolLibListener implements Listener { @EventHandler(ignoreCancelled = true) public void onNPCDespawn(NPCDespawnEvent event) { - if (event.getNPC().getEntity() != null) { - rotationTraits.remove(event.getNPC().getEntity().getEntityId()); - } + if (event.getNPC().getEntity() == null) + return; + rotationTraits.remove(event.getNPC().getEntity().getEntityId()); mirrorTraits.remove(event.getNPC().getEntity().getUniqueId()); }