Skip to content

Commit 875b084

Browse files
committed
Fix exception when searching; path added twice.
This is a simple fix. I am not sure why paths are added twice, but consists are not. Both appear twice in the hierarchy.
1 parent 53a4f91 commit 875b084

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/Contrib/ContentManager/ContentManagerGUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ void searchBox_TextChanged(object sender, EventArgs e)
286286
finds.Add(new SearchResult(content, path));
287287

288288
foreach (var child in ((ContentType[])Enum.GetValues(typeof(ContentType))).SelectMany(ct => content.Get(ct)))
289-
pending.Add(path + " / " + child.Name, child);
289+
if (!pending.ContainsKey(path + " / " + child.Name))
290+
pending.Add(path + " / " + child.Name, child);
290291

291292
foreach (var child in ContentLink.Matches(ContentInfo.GetText(content)).Cast<Match>().Select(linkMatch => content.Get(linkMatch.Groups[1].Value, (ContentType)Enum.Parse(typeof(ContentType), linkMatch.Groups[2].Value))).Where(linkContent => linkContent != null))
292293
if (!pending.ContainsKey(path + " -> " + child.Name))

0 commit comments

Comments
 (0)