Skip to content

fix(cli): prevent crash on non-string YAML properties (Issue #75)#79

Merged
davideast merged 1 commit into
google-labs-code:mainfrom
SyedaQurratAI:main
Jun 2, 2026
Merged

fix(cli): prevent crash on non-string YAML properties (Issue #75)#79
davideast merged 1 commit into
google-labs-code:mainfrom
SyedaQurratAI:main

Conversation

@SyedaQurratAI
Copy link
Copy Markdown
Contributor

Fixed the "raw.match is not a function" crash (Issue #75) by adding type guards for non-string YAML properties.

Changes:

Added typeof checks in parseDimensionParts and parseCssColor.

Updated ModelHandler to handle numeric/boolean values gracefully.

@SyedaQurratAI
Copy link
Copy Markdown
Contributor Author

Hi team! I've resolved the non-string YAML properties crash for Issue #75 and signed the CLA. Could a maintainer please approve the pending workflow scans so the checks can run? Thank you!

@davideast
Copy link
Copy Markdown
Collaborator

Hey @SyedaQurratAI! Apologies on the delay here, it's been a busy few weeks. Thank you so much for taking the time to contribute. I'm getting to this review today.

Copy link
Copy Markdown
Collaborator

@davideast davideast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @SyedaQurratAI.

@davideast davideast merged commit a02b2d7 into google-labs-code:main Jun 2, 2026
4 checks passed
davideast added a commit that referenced this pull request Jun 2, 2026
…sue #75 tests (#94)

The component property loop only checked for typeof 'number' before
passing values to string-only helpers (isTokenReference, isValidColor,
isParseableDimension). Boolean YAML values (e.g. visible: true) fell
through to those helpers and only survived by accident due to the typeof
guards added in PR #79. This change handles booleans explicitly alongside
numbers so the intent is clear.

Adds three tests covering the exact reproducer from Issue #75
(opacity: 0.9), boolean properties (visible: true), and a mixed case
with numbers, booleans, and strings in the same component.
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.

3 participants