Skip to content

fix: use isset to detect required args provided as empty arrays#286

Merged
markdumay merged 2 commits intomainfrom
develop
Mar 6, 2026
Merged

fix: use isset to detect required args provided as empty arrays#286
markdumay merged 2 commits intomainfrom
develop

Conversation

@markdumay
Copy link
Collaborator

Empty slices are falsy in Hugo, so the previous truthiness check on index $namedargs $key incorrectly raised an "expected value" error for required arguments passed as []. Replace with isset which returns true whenever the key exists regardless of its value.

🤖 Generated with Claude Code

markdumay and others added 2 commits March 6, 2026 14:14
Empty slices are falsy in Hugo, so the previous truthiness check on
`index $namedargs $key` incorrectly raised an "expected value" error
for required arguments passed as `[]`. Replace with `isset` which
returns true whenever the key exists regardless of its value.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@markdumay markdumay enabled auto-merge March 6, 2026 13:15
@markdumay markdumay merged commit 3f31600 into main Mar 6, 2026
11 checks passed
@markdumay
Copy link
Collaborator Author

🎉 This PR is included in version 5.15.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant