mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-13 11:59:13 +00:00
Bug fix
Some checks failed
Some checks failed
This commit is contained in:
parent
11343a30fd
commit
9c58fec8d4
1 changed files with 26 additions and 16 deletions
|
@ -186,27 +186,37 @@ public class ProfileGroupItemManager
|
||||||
visited.Add(indexId);
|
visited.Add(indexId);
|
||||||
stack.Add(indexId);
|
stack.Add(indexId);
|
||||||
|
|
||||||
Instance.TryGet(indexId, out var groupItem);
|
try
|
||||||
|
|
||||||
if (groupItem == null || groupItem.ChildItems.IsNullOrEmpty())
|
|
||||||
{
|
{
|
||||||
|
Instance.TryGet(indexId, out var groupItem);
|
||||||
|
|
||||||
|
if (groupItem == null || groupItem.ChildItems.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var childIds = Utils.String2List(groupItem.ChildItems)
|
||||||
|
.Where(p => !string.IsNullOrEmpty(p))
|
||||||
|
.ToList();
|
||||||
|
if (childIds == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var child in childIds)
|
||||||
|
{
|
||||||
|
if (HasCycle(child, visited, stack))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
var childIds = Utils.String2List(groupItem.ChildItems)
|
|
||||||
.Where(p => !string.IsNullOrEmpty(p))
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
foreach (var child in childIds)
|
|
||||||
{
|
{
|
||||||
if (HasCycle(child, visited, stack))
|
stack.Remove(indexId);
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.Remove(indexId);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<(List<ProfileItem> Items, ProfileGroupItem? Group)> GetChildProfileItems(string? indexId)
|
public static async Task<(List<ProfileItem> Items, ProfileGroupItem? Group)> GetChildProfileItems(string? indexId)
|
||||||
|
|
Loading…
Reference in a new issue