File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,13 @@ const Field = ({
53
53
if ( ! hiddenSchemaProp ) {
54
54
return true
55
55
}
56
- const value = JSONPath ( { path : hiddenSchemaProp . match , json : formData } ) ?. [ 0 ]
57
- const isHidden = value === undefined || hiddenSchemaProp . condition === value
58
- // NOTE: if should be hidden then filter it out i.e return false
59
- return ! isHidden
56
+ try {
57
+ const value = JSONPath ( { path : hiddenSchemaProp . match , json : formData } ) ?. [ 0 ]
58
+ const isHidden = value === undefined || hiddenSchemaProp . condition === value
59
+ return ! isHidden
60
+ } catch {
61
+ return true
62
+ }
60
63
} )
61
64
// NOTE: we probably should use uiSchema instead?
62
65
. sort ( ( prop ) => ( schema . properties ?. [ prop . name ] ?. type === 'boolean' ? - 1 : 1 ) )
Original file line number Diff line number Diff line change @@ -251,7 +251,9 @@ export const validateUniqueKeys = (keys: string[]) => {
251
251
252
252
export const validateJSON = ( json : string ) : ValidationResponseType => {
253
253
try {
254
- JSON . parse ( json )
254
+ if ( json ) {
255
+ JSON . parse ( json )
256
+ }
255
257
return {
256
258
isValid : true ,
257
259
}
You can’t perform that action at this time.
0 commit comments