From fc612c608ff002c388228fea62fbbcf2d8c647b4 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Sat, 17 May 2025 15:01:47 +1000 Subject: [PATCH] Fix world importer breaking if there are no files to import --- .../me/cortex/voxy/commonImpl/importers/WorldImporter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java b/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java index 39c2bd24..8b97f81a 100644 --- a/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java +++ b/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java @@ -120,9 +120,13 @@ public class WorldImporter implements IDataImporter { @Override public void runImport(IUpdateCallback updateCallback, ICompletionCallback completionCallback) { - if (this.isRunning || this.worker == null) { + if (this.isRunning) { throw new IllegalStateException(); } + if (this.worker == null) {//Can happen if no files + completionCallback.onCompletion(0); + return; + } this.isRunning = true; this.updateCallback = updateCallback; this.completionCallback = completionCallback;