Browse Source

添加边界判断

leiyasi 1 year ago
parent
commit
593df76c75
1 changed files with 2 additions and 0 deletions
  1. 2 0
      GameClient/Assets/Game/HotUpdate/Views/Friend/FriendView.cs

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendView.cs

@@ -246,7 +246,9 @@ namespace GFGGame
             int selectedIndex = 0;
             if (_ui.m_list.numItems > 0)
             {
+                if (_ui.m_list.selectedIndex < 0) return;
                 _ui.m_list.ScrollToView(_ui.m_list.selectedIndex);
+
                 int childIndex = _ui.m_list.ItemIndexToChildIndex(_ui.m_list.selectedIndex);
                 if (childIndex < 0) return;
                 GButton item = _ui.m_list.GetChildAt(childIndex).asButton.GetChild("btnSend").asButton;