Fix world importer breaking if there are no files to import

This commit is contained in:
mcrcortex
2025-05-17 15:01:47 +10:00
parent 40c6d50d5e
commit fc612c608f

View File

@@ -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;