From f20231ccbcf2dbaf9a90ccdea435acd5d5e78b06 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 8 Feb 2025 11:38:36 -0600 Subject: [PATCH] fix rare null pointer in sharedApi --- .../distanthorizons/core/api/internal/SharedApi.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java index 65da1cfe2..db4043198 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java @@ -562,8 +562,11 @@ public class SharedApi if (remainingSlots <= 0) { DhChunkPos furthest = this.furthestQueue.poll(); - this.closestQueue.remove(furthest); - this.updateDataByChunkPos.remove(furthest); + if (furthest != null) + { + this.closestQueue.remove(furthest); + this.updateDataByChunkPos.remove(furthest); + } } this.updateDataByChunkPos.put(pos, updateData);