Skip to content

Commit

Permalink
fix(config): Safeguard access to nested msg.data.dataLayer properties
Browse files Browse the repository at this point in the history
  • Loading branch information
csulit committed Oct 18, 2024
1 parent bf479ff commit d13d769
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/deno-kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ export async function listenQueue(kv: Deno.Kv) {
propertyId = 4;
}

const agentId = msg.data.dataLayer.agent_id;
const agentName = msg.data.dataLayer.agent_name;
const productOwnerId = msg.data.dataLayer.product_owner;
const productOwnerName = msg.data.dataLayer.product_owner_name;
const agentId = msg.data.dataLayer?.agent_id;
const agentName = msg.data.dataLayer?.agent_name;
const productOwnerId = msg.data.dataLayer?.product_owner;
const productOwnerName = msg.data.dataLayer?.product_owner_name;
const location: Location = msg.data.dataLayer.location;
const dataLayerAttributes = msg.data.dataLayer.attributes;
const offerTypeId =
Expand Down

0 comments on commit d13d769

Please sign in to comment.