mirror of https://github.com/2dust/v2rayN
Bug fix
parent
83b4f1e660
commit
b99b30163b
|
@ -105,9 +105,12 @@ namespace v2rayN
|
||||||
/// <param name="filePath"></param>
|
/// <param name="filePath"></param>
|
||||||
/// <param name="nullValue"></param>
|
/// <param name="nullValue"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int ToFile(object? obj, string filePath, bool nullValue = true)
|
public static int ToFile(object? obj, string? filePath, bool nullValue = true)
|
||||||
{
|
{
|
||||||
int result;
|
if (filePath is null)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using FileStream file = File.Create(filePath);
|
using FileStream file = File.Create(filePath);
|
||||||
|
@ -119,14 +122,13 @@ namespace v2rayN
|
||||||
};
|
};
|
||||||
|
|
||||||
JsonSerializer.Serialize(file, obj, options);
|
JsonSerializer.Serialize(file, obj, options);
|
||||||
result = 0;
|
return 0;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logging.SaveLog(ex.Message, ex);
|
Logging.SaveLog(ex.Message, ex);
|
||||||
result = -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -25,6 +25,11 @@ namespace v2rayN.Handler
|
||||||
msg = ResUI.CheckServerSettings;
|
msg = ResUI.CheckServerSettings;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (node.GetNetwork() == nameof(ETransport.kcp))
|
||||||
|
{
|
||||||
|
msg = ResUI.Incorrectconfiguration + $" - {node.GetNetwork()}";
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
msg = ResUI.InitialConfiguration;
|
msg = ResUI.InitialConfiguration;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,8 @@ namespace v2rayN.Handler
|
||||||
string fileName = Utils.GetConfigPath(Global.CoreConfigFileName);
|
string fileName = Utils.GetConfigPath(Global.CoreConfigFileName);
|
||||||
if (CoreConfigHandler.GenerateClientConfig(node, fileName, out string msg, out string content) != 0)
|
if (CoreConfigHandler.GenerateClientConfig(node, fileName, out string msg, out string content) != 0)
|
||||||
{
|
{
|
||||||
ShowMsg(false, msg);
|
ShowMsg(false, msg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue