Skip to content

Ensure blur reports the received value for invalid sigma - #4636

Closed
cherenkov wants to merge 1 commit into
lovell:mainfrom
cherenkov:upstream/blur-sigma-error-message
Closed

cherenkov wants to merge 1 commit into
lovell:mainfrom
cherenkov:upstream/blur-sigma-error-message

Conversation

@cherenkov

Copy link
Copy Markdown
Contributor

blur() reports received undefined of type undefined for any invalid sigma,
because the local sigma variable is passed to invalidParameterError before it is assigned.

Input Before After
blur({ sigma: 'x' }) received undefined of type undefined received x of type string
blur('5') received undefined of type undefined received 5 of type string

This initialises sigma from options, which also removes the redundant number branch,
and passes options.sigma when validating the object form.

Unit tests are added for both cases. They fail without this change.

🤖 Generated with Claude Code

`sigma` was declared without an initial value, so validation errors for
`blur({ sigma: 'x' })` and `blur('5')` always reported
"received undefined of type undefined". Initialise `sigma` from
`options` and pass `options.sigma` when validating the object form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lovell

lovell commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR. I note the use of LLM-based tooling. Please can you, a human, confirm this meets the contribution guidelines.

@cherenkov cherenkov closed this Oct 18, 2026
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