mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2024-12-15 06:50:12 +08:00
parent
8e28c2487f
commit
a96fe298b8
@ -277,9 +277,7 @@ public class ModUpdatesPage extends BorderPane implements DecoratorPage {
|
||||
dependents = mods.stream()
|
||||
.map(mod -> {
|
||||
return Task
|
||||
.runAsync(Schedulers.javafx(), () -> {
|
||||
mod.getKey().setOld(true);
|
||||
})
|
||||
.runAsync(Schedulers.javafx(), () -> mod.getKey().setOld(true))
|
||||
.thenComposeAsync(() -> {
|
||||
FileDownloadTask task = new FileDownloadTask(
|
||||
new URL(mod.getValue().getFile().getUrl()),
|
||||
@ -326,6 +324,8 @@ public class ModUpdatesPage extends BorderPane implements DecoratorPage {
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
if (!isDependentsSucceeded())
|
||||
throw getException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -709,7 +709,7 @@ public abstract class Task<T> {
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
if (isDependentsSucceeded() != (Task.this.getException() == null))
|
||||
throw new AssertionError("When whenComplete succeeded, Task.exception must be null.");
|
||||
throw new AssertionError("When whenComplete succeeded, Task.exception must be null.", Task.this.getException());
|
||||
|
||||
action.execute(Task.this.getException());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user