mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 11:23:00 +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:
parent
66f86bdee5
commit
c514233141
@ -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 } });
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user