Browse Source

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.
tags/3.3.6
noisyfox 8 years ago
parent
commit
206e0b8cb5
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      shadowsocks-csharp/Model/Configuration.cs

+ 2
- 0
shadowsocks-csharp/Model/Configuration.cs View File

@@ -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)


Loading…
Cancel
Save