From ca80e1e83129fed5927f34fbc959cace3187cb23 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Tue, 23 Sep 2025 12:46:59 +0800 Subject: [PATCH] Avoid self-reference --- .../CoreConfig/Singbox/SingboxOutboundService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs index 6ec279a1..bd03b4c8 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxOutboundService.cs @@ -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();