Skip to content

fix: handle null MCP asset input - #472

Open
konkonrong-lgtm wants to merge 1 commit into
salesforcecli:mainfrom
konkonrong-lgtm:fix-mcp-asset-replace-null
Open

fix: handle null MCP asset input#472
konkonrong-lgtm wants to merge 1 commit into
salesforcecli:mainfrom
konkonrong-lgtm:fix-mcp-asset-replace-null

Conversation

@konkonrong-lgtm

Copy link
Copy Markdown

What does this PR do?

Handles null JSON input passed to sf agent mcp asset replace --assets.

Previously, null was successfully parsed as JSON and the command attempted to access .assets on it, resulting in a raw TypeError:

Cannot read properties of null (reading 'assets')

This change uses safe property access so invalid input falls through to the existing InvalidShape validation.

A regression test was added for --assets null.

Test results:

  • yarn test:only — 448 passing
  • yarn build — successful

What issues does this PR fix or reference?

Fixes forcedotcom/cli#3625

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sf agent mcp asset replace --assets null throws raw TypeError instead of InvalidShape

1 participant