Skip to content

Commit d104f01

Browse files
densumeshskeptrunedev
authored andcommitted
Feature: fix webhook crashing
1 parent 4847e30 commit d104f01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clients/trieve-shopify-extension/app/processors/getProducts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,13 @@ export async function sendChunksFromWebhook(
285285
}
286286
let data = response.data as {
287287
data: {
288-
productVariant: {
288+
productVariant?: {
289289
metafields: { nodes: { key: string; value: string }[] };
290290
};
291291
};
292292
};
293293

294-
variant.metafields = data?.data.productVariant.metafields.nodes;
294+
variant.metafields = data?.data.productVariant?.metafields.nodes ?? [];
295295
return createChunkFromProductWebhook(
296296
product,
297297
variant,

0 commit comments

Comments
 (0)