From cfe55f3da7f5beea3ebf44771f601252ed4a5bac Mon Sep 17 00:00:00 2001 From: ujjwal-ab Date: Wed, 13 Dec 2023 14:19:54 +0530 Subject: [PATCH] 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]});