From 4b4b623fee7752cbc24cf9ca068e08d985aa4d74 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 26 Jun 2023 20:59:31 +0200 Subject: [PATCH] Hotfix NPE in FreezeListener Signed-off-by: yoyosource --- .../de/steamwar/bausystem/features/region/FreezeListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java index d810ce61..10beca8f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java @@ -100,7 +100,9 @@ public class FreezeListener implements Listener, ScoreboardElement { @EventHandler public void onInventoryMoveEvent(InventoryMoveItemEvent e) { - if (Region.getRegion(e.getDestination().getLocation()).get(Flag.FREEZE) == FreezeMode.ACTIVE) { + if (e.getDestination().getLocation() != null && Region.getRegion(e.getDestination().getLocation()).get(Flag.FREEZE) == FreezeMode.ACTIVE) { + e.setCancelled(true); + } else if (e.getSource().getLocation() != null && Region.getRegion(e.getSource().getLocation()).get(Flag.FREEZE) == FreezeMode.ACTIVE) { e.setCancelled(true); } }