对禁止取消的操作禁用取消按钮#5948
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 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); |
There was a problem hiding this comment.
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 👍 / 👎.
No description provided.