Browse Source

Bugly服装合成onshow防止报错

huangxiaoyue 1 year ago
parent
commit
52e8a78daf

+ 7 - 3
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -111,9 +111,13 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-
-            _suitId = (int)(this.viewData as object[])[0];
-            _selectedItemId = (this.viewData as object[]).Length > 1 ? (int)(this.viewData as object[])[1] : 0;
+            _suitId = 0;
+            _selectedItemId = 0;
+            if (this.viewData != null)
+            {
+                _suitId = (int)(this.viewData as object[])[0];
+                _selectedItemId = (this.viewData as object[]).Length > 1 ? (int)(this.viewData as object[])[1] : 0;
+            }
             _valueBarController.OnShown();
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hc_bj_1");