@nuskin/ns-product-lib 2.17.0-cx24-5822.5 → 2.17.0-cx24-5822.6

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.17.0-cx24-5822.5",
3
+ "version": "2.17.0-cx24-5822.6",
4
4
  "description": "This project contains shared Product models and code between the backend and frontend.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -116,7 +116,10 @@ async function getProducts(ids, market, locale, config) {
116
116
  try {
117
117
  const { data } = await graphQlHttpRequest(payload, config);
118
118
 
119
- if (data && data.data && data.data.productsById && data.data.productsById.products) {
119
+ if (data && data.data &&
120
+ data.data.productsById &&
121
+ data.data.productsById.products &&
122
+ data.data.productsById.products.length) {
120
123
 
121
124
  //use to get default variant based on requested sku
122
125
  productsData.products = data.data.productsById.products.map((product,index)=>{