mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-12 18:42:07 +01:00
SPIGOT-7308: Fix NullPointerException when calling Jukebox#setRecord()
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
parent
c9cdfcc603
commit
bc7c41cfbc
@ -66,3 +66,16 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -203,7 +246,11 @@
|
||||
@VisibleForTesting
|
||||
public void setRecordWithoutPlaying(ItemStack itemstack) {
|
||||
this.items.set(0, itemstack);
|
||||
- this.level.updateNeighborsAt(this.getBlockPos(), this.getBlockState().getBlock());
|
||||
+ // CraftBukkit start - add null check for level
|
||||
+ if (level != null) {
|
||||
+ this.level.updateNeighborsAt(this.getBlockPos(), this.getBlockState().getBlock());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.setChanged();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user