mirror of https://github.com/ppy/osu
Fix crash when trying to migrate collection database that doesn't exist
This commit is contained in:
parent
ae0fea8e26
commit
fc58b202b1
|
@ -208,8 +208,13 @@ private void load(ReadableKeyCombinationProvider keyCombinationProvider)
|
|||
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