Skip to content

Commit

Permalink
fix(reddit): add undefined check for eventsMapping field (#2905)
Browse files Browse the repository at this point in the history
feat: add undefined check for evensMapping field
  • Loading branch information
ujjwal-ab authored Dec 13, 2023
1 parent 7825c19 commit a606ec1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cdk/v2/destinations/reddit/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]});
Expand Down

0 comments on commit a606ec1

Please sign in to comment.