#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.
This commit is contained in:
blablubbabc 2021-10-15 18:03:01 +11:00 committed by md_5
parent 960f31098d
commit 11c9299fbb
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

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