From 7ca947b05f4fce4b9a025991ed1e8ed22acb05b3 Mon Sep 17 00:00:00 2001 From: akatatsu27 Date: Tue, 26 Jul 2022 17:58:28 +0300 Subject: [PATCH] fix nullPointer error --- src/main/java/emu/grasscutter/scripts/SceneScriptManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java index 38991551b..2040f148d 100644 --- a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java +++ b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java @@ -213,7 +213,7 @@ public class SceneScriptManager { } for(int entityId : region.getEntities()) { - if(!region.getMetaRegion().contains(getScene().getEntityById(entityId).getPosition())) { + if(getScene().getEntityById(entityId) == null || !region.getMetaRegion().contains(getScene().getEntityById(entityId).getPosition())) { region.removeEntity(entityId); }