Avoid self-reference

This commit is contained in:
DHR60 2025-09-23 12:46:59 +08:00
parent e7f75010d3
commit 2d41272659

View file

@ -219,16 +219,18 @@ public partial class CoreConfigSingboxService
} }
// remove custom nodes // remove custom nodes
// remove group nodes for proxy chain // remove group nodes for proxy chain
// avoid self-reference
var childProfiles = (await Task.WhenAll( var childProfiles = (await Task.WhenAll(
Utils.String2List(profileGroupItem.ChildItems) Utils.String2List(profileGroupItem.ChildItems)
.Where(p => !p.IsNullOrEmpty()) .Where(p => !p.IsNullOrEmpty())
.Select(AppManager.Instance.GetProfileItem) .Select(AppManager.Instance.GetProfileItem)
)) ))
.Where(p => .Where(p =>
p != null && p != null
p.IsValid() && && p.IsValid()
p.ConfigType != EConfigType.Custom && && p.ConfigType != EConfigType.Custom
(node.ConfigType == EConfigType.PolicyGroup || p.ConfigType < EConfigType.Group) && (node.ConfigType == EConfigType.PolicyGroup || p.ConfigType < EConfigType.Group)
&& p.IndexId != node.IndexId
) )
.ToList(); .ToList();