error catch

This commit is contained in:
mcrcortex
2025-04-26 21:12:02 +10:00
parent ec42f47d9e
commit e032ea43e2

View File

@@ -143,6 +143,9 @@ public class ActiveSectionTracker {
if (section.trySetFreed()) { if (section.trySetFreed()) {
var cached = cache.remove(section.key); var cached = cache.remove(section.key);
var obj = cached.obj; var obj = cached.obj;
if (obj == null) {
throw new IllegalStateException("This should be impossible");
}
if (obj != section) { 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)); 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));
} }