mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-09-18 21:54:50 +00:00
SPIGOT-7308: Fix NullPointerException when calling Jukebox#setRecord()
This commit is contained in:
parent
388d458a61
commit
f5b61387e1
1 changed files with 13 additions and 0 deletions
|
@ -66,3 +66,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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…
Add table
Reference in a new issue