mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-01-30 14:39:56 +08:00
Fix: keep not completed Curse modpack game version
This commit is contained in:
parent
529c4ed420
commit
944d88b8af
@ -107,9 +107,6 @@ public final class ModpackHelper {
|
||||
if (ex instanceof CurseCompletionException && !(ex.getCause() instanceof FileNotFoundException)) {
|
||||
success.run();
|
||||
// This is tolerable and we will not delete the game
|
||||
} else {
|
||||
HMCLGameRepository repository = profile.getRepository();
|
||||
repository.removeVersionFromDisk(name);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -32,6 +32,7 @@ import org.jackhuang.hmcl.util.gson.JsonUtils;
|
||||
import org.jackhuang.hmcl.util.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
@ -84,7 +85,12 @@ public final class CurseInstallTask extends Task<Void> {
|
||||
dependents.add(builder.buildAsync());
|
||||
|
||||
onDone().register(event -> {
|
||||
if (event.isFailed()) repository.removeVersionFromDisk(name);
|
||||
Exception ex = event.getTask().getException();
|
||||
if (event.isFailed()) {
|
||||
if (!(ex instanceof CurseCompletionException) || ex.getCause() instanceof FileNotFoundException) {
|
||||
repository.removeVersionFromDisk(name);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ModpackConfiguration<CurseManifest> config = null;
|
||||
|
Loading…
Reference in New Issue
Block a user