Explorar o código

Bugly 词牌升星防止报错

huangxiaoyue hai 1 ano
pai
achega
4a20961c91
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      GameClient/Assets/Game/HotUpdate/Views/Card/CardUpView.cs

+ 6 - 2
GameClient/Assets/Game/HotUpdate/Views/Card/CardUpView.cs

@@ -159,6 +159,9 @@ namespace GFGGame
         private void RenderListCardPropertyItem(int index, GObject obj)
         {
             UI_ListScoreItem2 listItem = UI_ListScoreItem2.Proxy(obj);
+            if (_cardStarCfg == null)
+                ET.Log.Error("RenderListCardPropertyItemd _cardStarCfg is null");
+
             int typeIndex = 1;
             if (_cardStarCfg.score1 > 0)
                 typeIndex = 1;
@@ -168,8 +171,9 @@ namespace GFGGame
                 typeIndex = 3;
             else if (_cardStarCfg.score4 > 0)
                 typeIndex = 4;
-            if(_scores.ContainsKey(typeIndex))
-                listItem.m_txtProperty.text = _scores[typeIndex].ToString();
+
+            _scores.TryGetValue(typeIndex, out var scoresValue);
+            listItem.m_txtProperty.text = scoresValue.ToString();
             listItem.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + typeIndex);
             UI_ListScoreItem2.ProxyEnd();
         }