From 56e65fd3a7b64f3baccd3d4b5364133cc50a07d1 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 12 Oct 2021 13:35:29 -0700 Subject: [PATCH] Null check isApplicable for CraftBlockEntityState#update If the update call removed the TE, then isApplicable would have NPE'd. --- ...licable-for-CraftBlockEntityState-up.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 patches/server/0826-Null-check-isApplicable-for-CraftBlockEntityState-up.patch diff --git a/patches/server/0826-Null-check-isApplicable-for-CraftBlockEntityState-up.patch b/patches/server/0826-Null-check-isApplicable-for-CraftBlockEntityState-up.patch new file mode 100644 index 0000000000..9c6cad66cb --- /dev/null +++ b/patches/server/0826-Null-check-isApplicable-for-CraftBlockEntityState-up.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf +Date: Tue, 12 Oct 2021 13:32:52 -0700 +Subject: [PATCH] Null check isApplicable for CraftBlockEntityState#update + +If the update call removed the TE, then isApplicable would +have NPE'd. + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +index d2ff7e373476aaab0d4d08977c9d9f274fff67bf..a31162bbb37b79cb7f84956c91f2ef9efc4ededc 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +@@ -102,7 +102,7 @@ public abstract class CraftBlockEntityState extends Craft + } + + protected boolean isApplicable(BlockEntity tileEntity) { +- return this.tileEntity.getClass() == tileEntity.getClass(); ++ return tileEntity != null && this.tileEntity.getClass() == tileEntity.getClass(); // Paper - fix NPE if the TE was removed + } + + @Override