Fix issue deeply extract falsey values from context while executing JS bindings
This commit is contained in:
parent
932c332b81
commit
7d7c28d967
|
@ -19,7 +19,10 @@ const removeSquareBrackets = value => {
|
||||||
const getContextValue = (path, context) => {
|
const getContextValue = (path, context) => {
|
||||||
let data = context
|
let data = context
|
||||||
path.split(".").forEach(key => {
|
path.split(".").forEach(key => {
|
||||||
data = data[removeSquareBrackets(key)] || {}
|
if (data == null || typeof data !== "object") {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
data = data[removeSquareBrackets(key)]
|
||||||
})
|
})
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue