From c0551c0cf89604df7d6ff4b6a185c7e13907a739 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 23 Oct 2023 21:22:17 +0200 Subject: [PATCH] Fix SimulatorWatcher for non watched Simulator --- .../bausystem/features/simulator2/SimulatorWatcher.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator2/SimulatorWatcher.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator2/SimulatorWatcher.java index 5c1e8ddb..8bc0d8c6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator2/SimulatorWatcher.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator2/SimulatorWatcher.java @@ -58,8 +58,10 @@ public class SimulatorWatcher { public void update(Simulator simulator) { REntityServer rEntityServer = entityServers.get(simulator); - rEntityServer.getEntities().forEach(REntity::die); - createSim(rEntityServer, simulator); + if (rEntityServer != null) { + rEntityServer.getEntities().forEach(REntity::die); + createSim(rEntityServer, simulator); + } new ArrayList<>(watchers.values()).forEach(simulatorRunnablePair -> { if (simulatorRunnablePair.getKey() == simulator) {