Skip to content

Commit 05cabe7

Browse files
authored
Merge pull request #224 from cvanem/main
bugfix: Format customs fix to prevent null customs items from breaking HTTP request workflow
2 parents 6cef64d + 6b33280 commit 05cabe7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/get-rates-with-shipment-details/format-response.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ function formatCustoms(
240240
customs: Response.InternationalShipmentOptions
241241
): GetRatesWithShipmentDetailsTypes.Result["customs"] | null {
242242
return {
243-
contents: customs.contents,
244-
nonDelivery: customs.non_delivery,
245-
customsItems: customs.customs_items
243+
contents: customs?.contents,
244+
nonDelivery: customs?.non_delivery,
245+
customsItems: customs?.customs_items
246246
? formatCustomsItems(customs.customs_items)
247247
: null,
248248
};

0 commit comments

Comments
 (0)