1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-06 04:53:06 +08:00

Fix crash when clicking on ShowMore button

This commit is contained in:
Andrei Zavatski 2020-02-24 05:53:33 +03:00
parent 66317f9fcd
commit b0b52146ea

View File

@ -96,12 +96,17 @@ namespace osu.Game.Overlays.Comments
{ {
var orphaned = new List<Comment>(); var orphaned = new List<Comment>();
// Exclude possible duplicated comments.
foreach (var topLevel in bundle.Comments) foreach (var topLevel in bundle.Comments)
{
if (commentDictionary.ContainsKey(topLevel.Id))
continue;
addNewComment(topLevel); addNewComment(topLevel);
}
foreach (var child in bundle.IncludedComments) foreach (var child in bundle.IncludedComments)
{ {
// Included comments can contain the parent comment, which already exists in the hierarchy.
if (commentDictionary.ContainsKey(child.Id)) if (commentDictionary.ContainsKey(child.Id))
continue; continue;