Fix crashing when a nullish value exists in an object being recursed for enrichment
This commit is contained in:
parent
d3789c9069
commit
6fb50a1988
|
@ -27,11 +27,13 @@ function testObject(object) {
|
||||||
module.exports.processObject = async (object, context) => {
|
module.exports.processObject = async (object, context) => {
|
||||||
testObject(object)
|
testObject(object)
|
||||||
for (let key of Object.keys(object)) {
|
for (let key of Object.keys(object)) {
|
||||||
let val = object[key]
|
if (object[key] != null) {
|
||||||
if (typeof val === "string") {
|
let val = object[key]
|
||||||
object[key] = await module.exports.processString(object[key], context)
|
if (typeof val === "string") {
|
||||||
} else if (typeof val === "object") {
|
object[key] = await module.exports.processString(object[key], context)
|
||||||
object[key] = await module.exports.processObject(object[key], context)
|
} else if (typeof val === "object") {
|
||||||
|
object[key] = await module.exports.processObject(object[key], context)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return object
|
return object
|
||||||
|
|
Loading…
Reference in New Issue