Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Aug 4, 2024
1 parent bb4d399 commit 8023eb7
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions v2rayN/v2rayN/Handler/CoreConfig/CoreConfigSingbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,19 +389,24 @@ public int GenerateClientCustomConfig(ProfileItem node, string? fileName, out st
return -1;
}

var txtFile = File.ReadAllText(addressFileName);
var singboxConfig = JsonUtils.Deserialize<SingboxConfig>(txtFile);
if (singboxConfig == null)
if (node.address == Global.CoreMultipleLoadConfigFileName)
{
//msg = ResUI.FailedConversionConfiguration;
//return -1;
File.Copy(addressFileName, fileName);
var txtFile = File.ReadAllText(addressFileName);
var singboxConfig = JsonUtils.Deserialize<SingboxConfig>(txtFile);
if (singboxConfig == null)
{
File.Copy(addressFileName, fileName);
}
else
{
GenInbounds(singboxConfig);
GenExperimental(singboxConfig);
JsonUtils.ToFile(singboxConfig, fileName, false);
}
}
else
{
GenInbounds(singboxConfig);
GenExperimental(singboxConfig);
JsonUtils.ToFile(singboxConfig, fileName, false);
File.Copy(addressFileName, fileName);
}

//check again
Expand Down

0 comments on commit 8023eb7

Please sign in to comment.