#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.

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
CraftBukkit/Spigot 2021-10-15 18:03:01 +11:00
parent 571ec764a6
commit f9c1420daf

View file

@ -82,7 +82,7 @@ public abstract class CraftBlockEntityState<T extends TileEntity> extends CraftB
}
protected boolean isApplicable(TileEntity tileEntity) {
return this.tileEntity.getClass() == tileEntity.getClass();
return tileEntity != null && this.tileEntity.getClass() == tileEntity.getClass();
}
@Override