From 9f4af889f7c00075b360fedc30c76e923341e172 Mon Sep 17 00:00:00 2001 From: Yannick Lamprecht <1420893+yannicklamprecht@users.noreply.github.com> Date: Mon, 27 Dec 2021 11:01:28 +0100 Subject: [PATCH] fix: npe thrown in entity spawn listener (#3399) --- .../com/plotsquared/bukkit/listener/EntitySpawnListener.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java index 783622e63..e72732b9d 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java @@ -75,8 +75,7 @@ public class EntitySpawnListener implements Listener { public static void testCreate(final Entity entity) { @NonNull World world = entity.getWorld(); - if (areaName.equals(world.getName())) { - } else { + if (!world.getName().equals(areaName)) { areaName = world.getName(); hasPlotArea = PlotSquared.get().getPlotAreaManager().hasPlotArea(areaName); }