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:
noisyfox
2016-11-21 14:12:31 +11:00
parent 86eeba3b7d
commit 206e0b8cb5
@@ -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)