瀏覽代碼

Bug fix for production: fetching orders that didn't have any line items caused an error.

Lee Morgan 5 年之前
父節點
當前提交
a728b88ec4
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      controllers/helper.js

+ 1 - 0
controllers/helper.js

@@ -21,6 +21,7 @@ module.exports = {
                             recipes: []
                         });
 
+                        if(response.data.orders[i].line_items === undefined) continue;
                         for(let j = 0; j < response.data.orders[i].line_items.length; j++){
                             for(let k = 0; k < merchant.recipes.length; k++){
                                 if(response.data.orders[i].line_items[j].catalog_object_id === merchant.recipes[k].posId){