1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

Fix importing collections twice from stable causing a hard crash

Somehow a bindable equality check failure got through review. Not sure
if there's some way to protect against this going forward, but we may
want to.
This commit is contained in:
Dean Herbert 2021-02-23 15:57:41 +09:00
parent 66f86bdee5
commit c514233141

View File

@ -138,10 +138,10 @@ namespace osu.Game.Collections
PostNotification?.Invoke(notification);
var collection = readCollections(stream, notification);
await importCollections(collection);
var collections = readCollections(stream, notification);
await importCollections(collections);
notification.CompletionText = $"Imported {collection.Count} collections";
notification.CompletionText = $"Imported {collections.Count} collections";
notification.State = ProgressNotificationState.Completed;
}
@ -155,7 +155,7 @@ namespace osu.Game.Collections
{
foreach (var newCol in newCollections)
{
var existing = Collections.FirstOrDefault(c => c.Name == newCol.Name);
var existing = Collections.FirstOrDefault(c => c.Name.Value == newCol.Name.Value);
if (existing == null)
Collections.Add(existing = new BeatmapCollection { Name = { Value = newCol.Name.Value } });