Browse Source

Fix crash while showing config dialog.

If user manually deleted servers from gui-config.json
tags/3.3.6
noisyfox 7 years ago
parent
commit
86eeba3b7d
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      shadowsocks-csharp/View/ConfigForm.cs

+ 1
- 1
shadowsocks-csharp/View/ConfigForm.cs View File

@@ -151,7 +151,7 @@ namespace Shadowsocks.View
_modifiedConfiguration = controller.GetConfigurationCopy(); _modifiedConfiguration = controller.GetConfigurationCopy();
LoadConfiguration(_modifiedConfiguration); LoadConfiguration(_modifiedConfiguration);
_lastSelectedIndex = _modifiedConfiguration.index; _lastSelectedIndex = _modifiedConfiguration.index;
if (_lastSelectedIndex < 0)
if (_lastSelectedIndex < 0 || _lastSelectedIndex >= ServersListBox.Items.Count)
{ {
_lastSelectedIndex = 0; _lastSelectedIndex = 0;
} }


Loading…
Cancel
Save