From a7a925b54ef56123e4c44372724f6410a5095c80 Mon Sep 17 00:00:00 2001 From: Gauravudia Date: Wed, 20 Sep 2023 14:24:11 +0530 Subject: [PATCH] fix(mp incremental properties): add check for undefined properties --- src/v0/destinations/mp/transform.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/v0/destinations/mp/transform.js b/src/v0/destinations/mp/transform.js index 425b7a8249..4f55c3dcac 100644 --- a/src/v0/destinations/mp/transform.js +++ b/src/v0/destinations/mp/transform.js @@ -149,12 +149,14 @@ const processIncrementalProperties = (message, destination, propIncrements) => { payload.$distinct_id = message.userId || `$device:${message.anonymousId}`; } - Object.keys(message.properties).forEach((prop) => { - const value = message.properties[prop]; - if (value && propIncrements.includes(prop)) { - payload.$add[prop] = value; - } - }); + if (message.properties) { + Object.keys(message.properties).forEach((prop) => { + const value = message.properties[prop]; + if (value && propIncrements.includes(prop)) { + payload.$add[prop] = value; + } + }); + } return Object.keys(payload.$add).length > 0 ? responseBuilderSimple(payload, message, 'incremental_properties', destination.Config)