1
0
Fork 0
mirror of synced 2024-10-02 18:16:29 +13:00

Fix crashing when a nullish value exists in an object being recursed for enrichment

This commit is contained in:
Andrew Kingston 2021-01-21 13:46:45 +00:00
parent 4deccae711
commit ecbe24662a

View file

@ -27,11 +27,13 @@ function testObject(object) {
module.exports.processObject = async (object, context) => {
testObject(object)
for (let key of Object.keys(object)) {
let val = object[key]
if (typeof val === "string") {
object[key] = await module.exports.processString(object[key], context)
} else if (typeof val === "object") {
object[key] = await module.exports.processObject(object[key], context)
if (object[key] != null) {
let val = object[key]
if (typeof val === "string") {
object[key] = await module.exports.processString(object[key], context)
} else if (typeof val === "object") {
object[key] = await module.exports.processObject(object[key], context)
}
}
}
return object