fix ArgumentOutOfRangeException

This commit is contained in:
everyx
2015-10-11 00:21:25 +08:00
parent ad8a8c24e6
commit 1e9f1f3764
+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;