mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Null check isApplicable for CraftBlockEntityState#update
If the update call removed the TE, then isApplicable would have NPE'd.
This commit is contained in:
parent
5eb18765ee
commit
55ca8ebefe
1 changed files with 21 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||||
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||||
|
@@ -0,0 +0,0 @@ public abstract class CraftBlockEntityState<T extends BlockEntity> 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
|
Loading…
Reference in a new issue