From 1d3363cbc101946f605c926ef35d5d5d5a6421b7 Mon Sep 17 00:00:00 2001 From: Wisley Date: Tue, 28 Nov 2023 11:05:33 -0300 Subject: [PATCH] fix(get new freigth): fix shipping_line error is undefined --- functions/lib/galaxpay/update-subscription.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/lib/galaxpay/update-subscription.js b/functions/lib/galaxpay/update-subscription.js index 8e7b8b9..4a360ec 100644 --- a/functions/lib/galaxpay/update-subscription.js +++ b/functions/lib/galaxpay/update-subscription.js @@ -81,7 +81,7 @@ const getNewFreight = async (storeId, itemsOrder, to, subtotal, shippingLineOrig return { app: sameApp, - service: service || sameApp.response?.shipping_services[0] + service: service || (sameApp.response?.shipping_services && sameApp.response?.shipping_services[0]) } } else { let minPrice = result[0]?.response?.shipping_services[0]?.shipping_line?.total_price