Browse Source

Bugly服装合成防止报错增加判null处理

huangxiaoyue 1 year ago
parent
commit
64cfe01872

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -377,6 +377,11 @@ namespace GFGGame
             int index = (int)(context.data as GObject).data;
             _ui.m_listMaterias.selectedIndex = index;
             ItemData itemData = _materiarsOfSelectedItem[index];
+            if (itemData == null)
+            {
+                ET.Log.Error("OnClickMateriasItemPlus itemData is null");
+                return;
+            }
             object[] sourceDatas = new object[] { itemData.id, new object[] { typeof(ClothingSyntheticView).FullName, new object[] { _suitId, _selectedItemId } }, (int)itemData.num };
             GoodsItemTipsController.ShowItemTips(itemData.id, sourceDatas);
         }