Skip to content

fix: pass falsy args to keep.* template functions - #6772

Open
DragonBot00 wants to merge 1 commit into
keephq:mainfrom
DragonBot00:fix/iohandler-falsy-args
Open

DragonBot00 wants to merge 1 commit into
keephq:mainfrom
DragonBot00:fix/iohandler-falsy-args

Conversation

@DragonBot00

Copy link
Copy Markdown
Contributor

Problem

IOHandler._parse_token silently drops falsy-but-valid arguments to keep.* template functions. When a function call resolves to [], {}, (), False, or 0, the argument is silently dropped instead of being passed to the function.

The current condition handles "", 0, and 0.0 but still drops [], {}, (), and False due to short-circuit evaluation.

Fix

Replace the complex condition with if _arg is not None:.

_arg is initialized to None and stays None only when no parsing branch matched (no real value produced). All other values including "", 0, False, [], {}, () are valid parsed results that should be passed through.

Testing

The edge cases that were previously dropped:

  • Empty list
  • Empty dict
  • Empty tuple
  • Boolean False
  • Zero

Fixes #6728

This branch has not been deployed

No deployments
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.

[🐛 Bug]: IOHandler silently drops empty list/dict/tuple (and literal False) arguments to keep.* template functions

1 participant