Avoid self-reference

This commit is contained in:
DHR60 2025-09-23 12:46:59 +08:00
parent 901f8101f0
commit ca80e1e831

View file

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