From b2a9e98bf4e62b1ac568c282dfdebc13c8a3156c Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 16 Mar 2013 16:03:38 +0100 Subject: [PATCH] fixed client crash on removing friends. Closes #1077 --- src/game/client/components/menus_browser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index b560b8cd2..42805e0bb 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -806,6 +806,8 @@ void CMenus::RenderServerbrowserFriends(CUIRect View) // friends list(remove friend) static float s_ScrollValue = 0; + if(m_FriendlistSelectedIndex >= m_lFriends.size()) + m_FriendlistSelectedIndex = m_lFriends.size()-1; UiDoListboxStart(&m_lFriends, &List, 30.0f, "", "", m_lFriends.size(), 1, m_FriendlistSelectedIndex, s_ScrollValue); m_lFriends.sort_range();