mirror of
https://github.com/2dust/v2rayN.git
synced 2026-08-23 07:32:05 +03:00
Fix (#10002)
This commit is contained in:
@@ -1797,21 +1797,18 @@ public static class ConfigHandler
|
||||
{
|
||||
ECoreType.Xray => V2rayFmt.ResolveToCustom(strData, subRemarks),
|
||||
ECoreType.sing_box => SingboxFmt.ResolveToCustom(strData, subRemarks),
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
|
||||
if (lstProfiles is not null)
|
||||
if ((lstProfiles?.Count ?? 0) == 0)
|
||||
{
|
||||
if (lstProfiles.Count == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
var count = await AddBatchCustomServers(config, lstProfiles, subid, isSub);
|
||||
if (count > 0)
|
||||
{
|
||||
return count;
|
||||
}
|
||||
var count = await AddBatchCustomServers(config, lstProfiles, subid, isSub);
|
||||
if (count > 0)
|
||||
{
|
||||
return count;
|
||||
}
|
||||
|
||||
return await SaveCustomRawFileServer(config, strData, subid, isSub, subItem, customCoreType);
|
||||
|
||||
@@ -34,9 +34,9 @@ public class SingboxFmt : BaseFmt
|
||||
if (!isOutbound)
|
||||
{
|
||||
var fullProfile = ResolveFull(jsonObject, subRemarks);
|
||||
profileList.Add(fullProfile);
|
||||
if (fullProfile is not null)
|
||||
{
|
||||
profileList.Add(fullProfile);
|
||||
return profileList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ public class V2rayFmt : BaseFmt
|
||||
if (!isOutbound)
|
||||
{
|
||||
var fullProfile = ResolveFull(jsonObject, subRemarks);
|
||||
profileList.Add(fullProfile);
|
||||
if (fullProfile is not null)
|
||||
{
|
||||
profileList.Add(fullProfile);
|
||||
return profileList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,8 @@ public partial class CoreConfigSingboxService
|
||||
fullConfigTemplateNode["outbounds"] = customOutboundsNode;
|
||||
|
||||
// Process endpoints
|
||||
if (fullConfigTemplateNode["endpoints"] is JsonArray { Count: > 0 } coreConfigEndpointsNode)
|
||||
var coreConfigEndpointsNode = coreConfigNode?["endpoints"] as JsonArray ?? [];
|
||||
if (coreConfigEndpointsNode is { Count: > 0 })
|
||||
{
|
||||
var customEndpointsNode = fullConfigTemplateNode["endpoints"] as JsonArray ?? [];
|
||||
foreach (var endpoint in coreConfigEndpointsNode)
|
||||
|
||||
Reference in New Issue
Block a user