From a606ec1ff138eed291a68fa78fd03e19c02b1622 Mon Sep 17 00:00:00 2001 From: Ujjwal Abhishek <63387036+ujjwal-ab@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:46:19 +0530 Subject: [PATCH] fix(reddit): add undefined check for eventsMapping field (#2905) feat: add undefined check for evensMapping field --- src/cdk/v2/destinations/reddit/procWorkflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cdk/v2/destinations/reddit/procWorkflow.yaml b/src/cdk/v2/destinations/reddit/procWorkflow.yaml index b07aeff962..65b466bc7c 100644 --- a/src/cdk/v2/destinations/reddit/procWorkflow.yaml +++ b/src/cdk/v2/destinations/reddit/procWorkflow.yaml @@ -51,7 +51,7 @@ steps: template: | let event = .message.event; let eventInLowerCase = event.trim().toLowerCase();; - let eventNames = .destination.Config.eventsMapping.(){.from === event}.to[] ?? []; + let eventNames = .destination.Config.eventsMapping? .destination.Config.eventsMapping.(){.from === event}.to[] ?? []: []; eventNames.length === 0 ? eventNames = $.ecomEventMaps.(){eventInLowerCase in .src}.dest[] ?? []; const event_type = (eventNames.length === 0 || eventNames[0]==="") ? ({"tracking_type": "Custom", "custom_event_name": event}): ({tracking_type: eventNames[0]});