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 b1e421651d
commit 4245430561
1 changed files with 4 additions and 1 deletions

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
}