mirror of https://github.com/ppy/osu
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,9 +208,14 @@ private void load(ReadableKeyCombinationProvider keyCombinationProvider)
|
|||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue