mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:07:44 +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:
commit
0d575006fb
@ -208,8 +208,13 @@ namespace osu.Game
|
||||
realm.CreateBackup($"client.{migration}.realm");
|
||||
|
||||
using (var source = Storage.GetStream("collection.db"))
|
||||
using (var destination = Storage.GetStream($"collection.{migration}.db", FileAccess.Write, FileMode.CreateNew))
|
||||
source.CopyTo(destination);
|
||||
{
|
||||
if (source != null)
|
||||
{
|
||||
using (var destination = Storage.GetStream($"collection.{migration}.db", FileAccess.Write, FileMode.CreateNew))
|
||||
source.CopyTo(destination);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies.CacheAs(Storage);
|
||||
|
Loading…
Reference in New Issue
Block a user