diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index 42f0042e..091d31eb 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -1256,6 +1256,7 @@ public static class ConfigHandler result.Success = false; return result; } + var childProfiles = await AppManager.Instance.ProfileItems(subId); List indexIdList = []; foreach (var regionFilter in PolicyGroupRegionFilters) @@ -1283,8 +1284,14 @@ public static class ConfigHandler }; profile.SetProtocolExtra(extraItem); - var childProfile = await GroupProfileManager.GetChildProfileItemsByProtocolExtra(extraItem); - if (childProfile.Count == 0) + var matchedChildProfiles = childProfiles?.Where(p => + p != null && + p.IsValid() && + !p.ConfigType.IsComplexType() && + (extraItem.Filter.IsNullOrEmpty() || Regex.IsMatch(p.Remarks, extraItem.Filter)) + ) + .ToList() ?? []; + if (matchedChildProfiles.Count == 0) { continue; }