mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-16 12:06:55 +02:00
parent
2a7d4fcde5
commit
7696d45093
1 changed files with 13 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue