Fix a null ref
if user manually deleted the whole 'configs' field in gui-config.json. Which won't crash the app but will lost all other configs.
This commit is contained in:
@@ -55,6 +55,8 @@ namespace Shadowsocks.Model
|
||||
Configuration config = JsonConvert.DeserializeObject<Configuration>(configContent);
|
||||
config.isDefault = false;
|
||||
|
||||
if (config.configs == null)
|
||||
config.configs = new List<Server>();
|
||||
if (config.configs.Count == 0)
|
||||
config.configs.Add(GetDefaultServer());
|
||||
if (config.localPort == 0)
|
||||
|
||||
Reference in New Issue
Block a user