Fix crash on startup when user manually deleted servers from gui-config.json
This commit is contained in:
@@ -54,6 +54,9 @@ namespace Shadowsocks.Model
|
||||
string configContent = File.ReadAllText(CONFIG_FILE);
|
||||
Configuration config = JsonConvert.DeserializeObject<Configuration>(configContent);
|
||||
config.isDefault = false;
|
||||
|
||||
if (config.configs.Count == 0)
|
||||
config.configs.Add(GetDefaultServer());
|
||||
if (config.localPort == 0)
|
||||
config.localPort = 1080;
|
||||
if (config.index == -1 && config.strategy == null)
|
||||
|
||||
Reference in New Issue
Block a user