From 605d0c6a9281e133d3d56f7460cc776c01831847 Mon Sep 17 00:00:00 2001 From: zkitefly Date: Sat, 20 May 2023 02:17:18 +0800 Subject: [PATCH] Fix #2204 (#2228) https://github.com/huanghongxun/HMCL/issues/2204#issuecomment-1519823562 --- .../jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java index bc1dc5520..4ce0b9be0 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java @@ -88,7 +88,9 @@ public class TaskExecutorDialogPane extends BorderPane { btnCancel.setOnAction(e -> { Optional.ofNullable(executor).ifPresent(TaskExecutor::cancel); - onCancel.getCancellationAction().accept(this); + if (onCancel.getCancellationAction() != null) { + onCancel.getCancellationAction().accept(this); + } }); speedEventHandler = speedEvent -> {