From 0b2b4cecbd56b5c197ea370cde3d2436eaf0863a Mon Sep 17 00:00:00 2001 From: Krysztal Date: Wed, 22 Mar 2023 13:20:56 +0800 Subject: [PATCH] Add non-null judgment for `Misc.getInventoryLocation(sourceInventory)` --- .../java/xyz/mackan/Slabbo/listeners/InventoryMoveListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Plugin/src/main/java/xyz/mackan/Slabbo/listeners/InventoryMoveListener.java b/modules/Plugin/src/main/java/xyz/mackan/Slabbo/listeners/InventoryMoveListener.java index 39fdc3ac..aca8bc71 100644 --- a/modules/Plugin/src/main/java/xyz/mackan/Slabbo/listeners/InventoryMoveListener.java +++ b/modules/Plugin/src/main/java/xyz/mackan/Slabbo/listeners/InventoryMoveListener.java @@ -36,7 +36,7 @@ public void onInventoryMove (InventoryMoveItemEvent e) { Location destinationLocation = Misc.getInventoryLocation(destinationInventory); Location sourceLocation = Misc.getInventoryLocation(sourceInventory); - if (destinationLocation == null) return; + if (destinationLocation == null || sourceLocation == null ) return; Block destinationBlock = destinationLocation.getBlock(); Block sourceBlock = sourceLocation.getBlock();