This commit is contained in:
DHR60
2026-08-22 02:17:09 +00:00
committed by GitHub
parent c66c55b05e
commit 26a86f9bd2
4 changed files with 12 additions and 14 deletions
+2 -5
View File
@@ -1797,12 +1797,10 @@ public static class ConfigHandler
{ {
ECoreType.Xray => V2rayFmt.ResolveToCustom(strData, subRemarks), ECoreType.Xray => V2rayFmt.ResolveToCustom(strData, subRemarks),
ECoreType.sing_box => SingboxFmt.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;
} }
@@ -1812,7 +1810,6 @@ public static class ConfigHandler
{ {
return count; return count;
} }
}
return await SaveCustomRawFileServer(config, strData, subid, isSub, subItem, customCoreType); return await SaveCustomRawFileServer(config, strData, subid, isSub, subItem, customCoreType);
} }
+1 -1
View File
@@ -34,9 +34,9 @@ public class SingboxFmt : BaseFmt
if (!isOutbound) if (!isOutbound)
{ {
var fullProfile = ResolveFull(jsonObject, subRemarks); var fullProfile = ResolveFull(jsonObject, subRemarks);
profileList.Add(fullProfile);
if (fullProfile is not null) if (fullProfile is not null)
{ {
profileList.Add(fullProfile);
return profileList; return profileList;
} }
} }
+1 -1
View File
@@ -34,9 +34,9 @@ public class V2rayFmt : BaseFmt
if (!isOutbound) if (!isOutbound)
{ {
var fullProfile = ResolveFull(jsonObject, subRemarks); var fullProfile = ResolveFull(jsonObject, subRemarks);
profileList.Add(fullProfile);
if (fullProfile is not null) if (fullProfile is not null)
{ {
profileList.Add(fullProfile);
return profileList; return profileList;
} }
} }
@@ -125,7 +125,8 @@ public partial class CoreConfigSingboxService
fullConfigTemplateNode["outbounds"] = customOutboundsNode; fullConfigTemplateNode["outbounds"] = customOutboundsNode;
// Process endpoints // 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 ?? []; var customEndpointsNode = fullConfigTemplateNode["endpoints"] as JsonArray ?? [];
foreach (var endpoint in coreConfigEndpointsNode) foreach (var endpoint in coreConfigEndpointsNode)