guodong преди 2 години
родител
ревизия
c5561542b6
променени са 1 файла, в които са добавени 8 реда и са изтрити 1 реда
  1. 8 1
      GameClient/Assets/Game/HotUpdate/DressUp/MyDressUpHelper.cs

+ 8 - 1
GameClient/Assets/Game/HotUpdate/DressUp/MyDressUpHelper.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using ET;
 
 namespace GFGGame
 {
@@ -48,7 +49,13 @@ namespace GFGGame
 
             for (int i = 0; i < equipDatas.Count; i++)
             {
-                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(equipDatas[i]);
+                var itemId = equipDatas[i];
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
+                if(itemCfg == null)
+                {
+                    Log.Warning($"id为 {itemId} 的物品没有配置,请查找原因!");
+                    continue;
+                }
                 if (itemCfg.subType == ConstDressUpItemType.LIAN_YI_QUN && itemCfg.id != ConstItemID.DEFULT_LIAN_YI_QUN)
                 {
                     isLianYiQun = true; break;