Merge pull request #345 from everyx/fix-ArgumentOutOfRangeException

fix ArgumentOutOfRangeException
This commit is contained in:
icylogic
2015-10-11 11:56:35 +08:00
+4 -1
View File
@@ -188,7 +188,10 @@ namespace Shadowsocks.View
ServersListBox.SelectedIndex = _lastSelectedIndex;
return;
}
ServersListBox.Items[_lastSelectedIndex] = _modifiedConfiguration.configs[_lastSelectedIndex].FriendlyName();
if (_lastSelectedIndex >= 0)
{
ServersListBox.Items[_lastSelectedIndex] = _modifiedConfiguration.configs[_lastSelectedIndex].FriendlyName();
}
UpdateMoveUpAndDownButton();
LoadSelectedServer();
_lastSelectedIndex = ServersListBox.SelectedIndex;