From e032ea43e26823440e92a2523d1bc6485789096b Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Sat, 26 Apr 2025 21:12:02 +1000 Subject: [PATCH] error catch --- .../java/me/cortex/voxy/common/world/ActiveSectionTracker.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java b/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java index 3e599d28..5840d23b 100644 --- a/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java +++ b/src/main/java/me/cortex/voxy/common/world/ActiveSectionTracker.java @@ -143,6 +143,9 @@ public class ActiveSectionTracker { if (section.trySetFreed()) { var cached = cache.remove(section.key); var obj = cached.obj; + if (obj == null) { + throw new IllegalStateException("This should be impossible"); + } if (obj != section) { throw new IllegalStateException("Removed section not the same as the referenced section in the cache: cached: " + obj + " got: " + section + " A: " + WorldSection.ATOMIC_STATE_HANDLE.get(obj) + " B: " +WorldSection.ATOMIC_STATE_HANDLE.get(section)); }