fix(v0): validation was crashing when a conditional reaches into a undefined fieldset value#261
Merged
Conversation
… fieldset
checkIfConditionMatchesProperties recursed into a nested fieldset with
formValues[name], which throws when that required fieldset is null/undefined
(e.g. imported/edited rows that omit it). Coalesce to {} so the nested
condition evaluates instead of crashing on a null property access.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
sandrina-p
commented
Jun 22, 2026
48a1d88 to
86c8851
Compare
86c8851 to
0bbe671
Compare
HanliTheron
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
V0 crashes when a schema conditional reaches into a nested fieldset whose value is
null/undefined. This happens for rows/payloads that omit a fieldset, throwing instead of validating.Example
Schema with a conditional that reaches into the
petfieldset:{ "type": "object", "properties": { "pet": { "type": "object", "x-jsf-presentation": { "inputType": "fieldset" }, "properties": { "species": { "type": "string", "enum": ["dog", "cat"] } } }, "pet_name": { "type": "string" } }, "allOf": [ { "if": { "properties": { "pet": { "properties": { "species": { "const": "dog" } } } }, "required": ["pet"] }, "then": { "required": ["pet_name"] } } ] }Validating a value that omits the fieldset crashes:
Root cause
checkIfConditionMatchesPropertiesrecurses into the fieldset withformValues["pet"]which has a null value, so then it crashes inside.Fix
Coalesce to
{}(formValues[name] ?? {}) so the nested condition evaluates instead of crashing.REF CPF-3408.
🤖 co-written with Claude Code