From c44c70133b9f22844f307e2172966292b79bce4c Mon Sep 17 00:00:00 2001 From: Frotty Date: Mon, 6 Jan 2025 23:20:24 +0100 Subject: [PATCH] Fix exception when hot reloading --- .../de/peeeq/wurstio/languageserver/requests/RunMap.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/requests/RunMap.java b/de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/requests/RunMap.java index ee83ffa4b..314c2b2c2 100644 --- a/de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/requests/RunMap.java +++ b/de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/requests/RunMap.java @@ -98,8 +98,10 @@ private String compileMap(ModelManager modelManager, WurstGui gui, WurstProjectC // first we copy in same location to ensure validity File buildDir = getBuildDir(); - mapLastModified = map.get().lastModified(); - mapPath = map.get().getAbsolutePath(); + if (map.isPresent()) { + mapLastModified = map.get().lastModified(); + mapPath = map.get().getAbsolutePath(); + } Optional testMap = map.map($ -> new File(buildDir, "WurstRunMap.w3x")); CompilationResult result = compileScript(modelManager, gui, testMap, projectConfig, buildDir, false);