From af70de316ecee2451f982b15b0996f935ca36c88 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Sat, 6 Jul 2024 22:47:37 -0400 Subject: [PATCH] fix(SceneScriptManager.java): Catch Lua groups NPE this is a weird issue; found it while testing networking stack and it also crashed the network thread --- .../java/emu/grasscutter/scripts/SceneScriptManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java index 4e5229600..3ef0d17ff 100644 --- a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java +++ b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java @@ -507,6 +507,12 @@ public class SceneScriptManager { .forEach( block -> { block.load(sceneId, meta.context); + if (block.groups == null) { + Grasscutter.getLogger() + .error("block.groups null for block {}", block.id); + return; + } + block.groups.values().stream() .filter(g -> !g.dynamic_load) .forEach(