We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7637009 commit b1b90e0Copy full SHA for b1b90e0
HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java
@@ -31,7 +31,6 @@
31
import org.jackhuang.hmcl.util.i18n.I18n;
32
import org.jetbrains.annotations.NotNull;
33
34
-import java.util.Optional;
35
import java.util.function.Consumer;
36
37
import static org.jackhuang.hmcl.ui.FXUtils.onEscPressed;
@@ -83,8 +82,9 @@ public TaskExecutorDialogPane(@NotNull TaskCancellationAction cancel) {
83
82
setCancel(cancel);
84
85
btnCancel.setOnAction(e -> {
86
- Optional.ofNullable(executor).ifPresent(TaskExecutor::cancel);
87
if (onCancel.getCancellationAction() != null) {
+ if (executor != null)
+ executor.cancel();
88
onCancel.getCancellationAction().accept(this);
89
}
90
});
0 commit comments