Commit 0078453
fix(mcp): drop nullable local + null-forgiving suppression in press_input_action
PressInputActionTool.cs:86 copied ClickEntityTool's pre-ratchet
`string? sceneId = arguments["sceneId"]?.Type == JTokenType.String ?
arguments["sceneId"]!.Value<string>() : null;` into a new file, which
re-triggers the diff-ratchet linter's nullable-local and
null-forgiving-suppression BLOCK rules (CLAUDE.md § Anti-Patterns):
the local was typed `string?` and read the same indexer expression
twice, needing `!` to convince the compiler the second read was
non-null after the first read's null-check.
Root cause was the nullable local itself, not the `!` in isolation —
removed both by never materializing a nullable local at all: the
optional sceneId is now resolved with a single pattern-matched read
(`arguments["sceneId"] is { Type: JTokenType.String } sceneIdToken`)
inlined directly into the McpInputActionIntent constructor call,
matching the ternaries already used for the adjacent eventType and
holdSec arguments in the same call. No behavior change.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018c638dR1vPysCMbYt2qQg51 parent 3e8f051 commit 0078453
1 file changed
Lines changed: 1 addition & 2 deletions
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | | - | |
| 89 | + | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
0 commit comments