json-logic-js
json-logic-js copied to clipboard
Fixed issues where scopedData is null
In rule like this
{"all" : [ {
var: 'current_value'
}, {
in: [
{
"var":""
},
[
0,
'A',
'B',
'C',
' '
]
]
} ]}
If current_value is undefined (null) I'll get error Cannot read property 'length' of null
Using the latest version I ran this:
jsonLogic.apply(
{"all" : [ {
var: 'current_value'
}, {
in: [
{
"var":""
},
[
0,
'A',
'B',
'C',
' '
]
]
} ]}
);
And it did not throw an error.