mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 21:17:52 +00:00
parent
2a7d4fcde5
commit
7696d45093
@ -75,7 +75,15 @@ namespace WinUI
|
||||
{
|
||||
byte[] tmp = File.ReadAllBytes(centralConfigPath);
|
||||
string json = Encoding.UTF8.GetString(tmp).Trim();
|
||||
Central = JsonConvert.DeserializeObject<CentralServer>(json);
|
||||
CentralServer ctmp = JsonConvert.DeserializeObject<CentralServer>(json);
|
||||
if (ctmp != null)
|
||||
{
|
||||
Central = ctmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
Central = new CentralServer();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -105,7 +113,10 @@ namespace WinUI
|
||||
{
|
||||
string json = JsonConvert.SerializeObject(Central);
|
||||
byte[] tmp = Encoding.UTF8.GetBytes(json);
|
||||
File.WriteAllBytes(CentralConfigFile(), tmp);
|
||||
if (tmp != null)
|
||||
{
|
||||
File.WriteAllBytes(CentralConfigFile(), tmp);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateRequestHeaders()
|
||||
|
Loading…
Reference in New Issue
Block a user