From 11c9299fbb8f559c1ba38e8f0e1695c4d33109ba Mon Sep 17 00:00:00 2001 From: blablubbabc Date: Fri, 15 Oct 2021 18:03:01 +1100 Subject: [PATCH] #940: Fixed a NPE during CraftBlockEntityState#update. When the BlockState's block type was changed, #update may have removed the TileEntity, causing #isApplicable to fail with a NPE. --- .../org/bukkit/craftbukkit/block/CraftBlockEntityState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java index 26409a4f5..1584bf8d9 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -82,7 +82,7 @@ public abstract class CraftBlockEntityState extends CraftB } protected boolean isApplicable(TileEntity tileEntity) { - return this.tileEntity.getClass() == tileEntity.getClass(); + return tileEntity != null && this.tileEntity.getClass() == tileEntity.getClass(); } @Override