Skip to content

对禁止取消的操作禁用取消按钮#5948

Merged
Glavo merged 1 commit into
HMCL-dev:mainfrom
CiiLu:ddddd
Apr 17, 2026
Merged

对禁止取消的操作禁用取消按钮#5948
Glavo merged 1 commit into
HMCL-dev:mainfrom
CiiLu:ddddd

Conversation

@CiiLu
Copy link
Copy Markdown
Contributor

@CiiLu CiiLu commented Apr 12, 2026

No description provided.

@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 17, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec40f91b9c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
if (executor != null)
executor.cancel();
onCancel.getCancellationAction().accept(this);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard null cancellation action before invoking callback

The click handler now always executes onCancel.getCancellationAction().accept(this), which can throw when the cancellation action is intentionally absent (e.g., TaskCancellationAction.NO_CANCEL). setCancel(...) currently disables the button only when the wrapper object is null, not when its inner action is null, so a later setCancel(TaskCancellationAction.NO_CANCEL) leaves the button enabled and this line will crash on click. Before this commit, the null guard prevented that failure.

Useful? React with 👍 / 👎.

@Glavo Glavo merged commit 6ef04d2 into HMCL-dev:main Apr 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants