1
0
Fork 0
mirror of synced 2024-07-02 04:50:44 +12:00

Fix issue deeply extract falsey values from context while executing JS bindings

This commit is contained in:
Andrew Kingston 2021-10-12 16:13:07 +01:00
parent 932c332b81
commit 7d7c28d967

View file

@ -19,7 +19,10 @@ const removeSquareBrackets = value => {
const getContextValue = (path, context) => {
let data = context
path.split(".").forEach(key => {
data = data[removeSquareBrackets(key)] || {}
if (data == null || typeof data !== "object") {
return null
}
data = data[removeSquareBrackets(key)]
})
return data
}