Fix uncaught IOException

This commit is contained in:
huangyuhui 2018-06-13 23:40:16 +08:00
parent eb565285b2
commit d61006dd67

View File

@ -41,6 +41,7 @@ import org.jackhuang.hmcl.ui.construct.TaskExecutorDialogPane;
import org.jackhuang.hmcl.util.*; import org.jackhuang.hmcl.util.*;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
@ -92,11 +93,15 @@ public final class LauncherHelper {
}) })
.then(Task.of(Schedulers.javafx(), () -> emitStatus(LoadingState.MODS))) .then(Task.of(Schedulers.javafx(), () -> emitStatus(LoadingState.MODS)))
.then(var -> { .then(var -> {
try {
ModpackConfiguration<?> configuration = ModpackHelper.readModpackConfiguration(repository.getModpackConfiguration(selectedVersion)); ModpackConfiguration<?> configuration = ModpackHelper.readModpackConfiguration(repository.getModpackConfiguration(selectedVersion));
if ("Curse".equals(configuration.getType())) if ("Curse".equals(configuration.getType()))
return new CurseCompletionTask(dependencyManager, selectedVersion); return new CurseCompletionTask(dependencyManager, selectedVersion);
else else
return null; return null;
} catch (IOException e) {
return null;
}
}) })
.then(Task.of(Schedulers.javafx(), () -> emitStatus(LoadingState.LOGGING_IN))) .then(Task.of(Schedulers.javafx(), () -> emitStatus(LoadingState.LOGGING_IN)))
.then(Task.of(Launcher.i18n("account.methods"), variables -> { .then(Task.of(Launcher.i18n("account.methods"), variables -> {