浏览代码

Bugly 服装升级防止报错

huangxiaoyue 1 年之前
父节点
当前提交
f80453c93f
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

+ 6 - 1
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -154,6 +154,11 @@ namespace GFGGame
             }
 
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_selectedItemId);
+            if (itemCfg == null) { 
+                ET.Log.Error("OnClickBtnProcuction itemCfg is null");
+                return;
+            }
+
             if (!ItemUtil.CheckItemEnough(itemCfg.syntheticCostID, itemCfg.syntheticCostNum))
             {
                 long has = ItemDataManager.GetItemNum(itemCfg.syntheticCostID);
@@ -165,7 +170,7 @@ namespace GFGGame
             for (int i = 0; i < materiarsOfSelectedItem.Count; i++)
             {
                 ItemData itemData = materiarsOfSelectedItem[i];
-                if (!ItemUtil.CheckItemEnough(materiarsOfSelectedItem[i].id, materiarsOfSelectedItem[i].num, true)) return;
+                if (itemData == null || !ItemUtil.CheckItemEnough(itemData.id, itemData.num, true)) return;
             }
             bool result = await ClothingSyntheticSProxy.ClothtingSynthetic(_selectedItemId);
             if (result)