Skip to content

Commit

Permalink
Fix rare QNB crash when leaving a single-player world (#7739)
Browse files Browse the repository at this point in the history
Got an NPE when leaving a single player world because it was trying to
destroy this QNB cluster (that had no center).
  • Loading branch information
shartte authored Mar 10, 2024
1 parent 796bb46 commit e5193b6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public QuantumCluster(BlockPos min, BlockPos max) {

@SubscribeEvent
public void onUnload(final LevelEvent.Unload e) {
if (this.center.getLevel() == e.getLevel()) {
if (this.center != null && this.center.getLevel() == e.getLevel()) {
this.setUpdateStatus(false);
this.destroy();
}
Expand Down

0 comments on commit e5193b6

Please sign in to comment.