From 5242973fe8749fa09b4e8a0621e89bee715687be Mon Sep 17 00:00:00 2001 From: Intelli Date: Tue, 14 May 2024 16:26:34 -0600 Subject: [PATCH] Fixed NullPointerException when hopper destination block is missing --- .../net/coreprotect/listener/player/HopperPushListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/coreprotect/listener/player/HopperPushListener.java b/src/main/java/net/coreprotect/listener/player/HopperPushListener.java index 9deafaa..8655435 100644 --- a/src/main/java/net/coreprotect/listener/player/HopperPushListener.java +++ b/src/main/java/net/coreprotect/listener/player/HopperPushListener.java @@ -20,6 +20,10 @@ public final class HopperPushListener { static void processHopperPush(Location location, InventoryHolder sourceHolder, InventoryHolder destinationHolder, ItemStack item) { Location destinationLocation = destinationHolder.getInventory().getLocation(); + if (destinationLocation == null) { + return; + } + String loggingChestId = "#hopper-push." + destinationLocation.getBlockX() + "." + destinationLocation.getBlockY() + "." + destinationLocation.getBlockZ(); Object[] lastAbort = ConfigHandler.hopperAbort.get(loggingChestId); if (lastAbort != null) {