1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:42:56 +08:00

Merge pull request #16605 from peppy/fix-collection-db-migrate-crash

Fix crash when trying to migrate collection database that doesn't exist
This commit is contained in:
Dean Herbert 2022-01-25 16:25:15 +09:00 committed by GitHub
commit 0d575006fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,9 +208,14 @@ namespace osu.Game
realm.CreateBackup($"client.{migration}.realm");
using (var source = Storage.GetStream("collection.db"))
{
if (source != null)
{
using (var destination = Storage.GetStream($"collection.{migration}.db", FileAccess.Write, FileMode.CreateNew))
source.CopyTo(destination);
}
}
}
dependencies.CacheAs(Storage);