mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Don't create destination stream if backup source doesn't exist
This commit is contained in:
parent
fca076b988
commit
e1e6be039a
@ -901,13 +901,13 @@ namespace osu.Game.Database
|
||||
try
|
||||
{
|
||||
using (var source = storage.GetStream(Filename, mode: FileMode.Open))
|
||||
using (var destination = storage.GetStream(backupFilename, FileAccess.Write, FileMode.CreateNew))
|
||||
{
|
||||
// source may not exist.
|
||||
if (source == null)
|
||||
return;
|
||||
|
||||
source.CopyTo(destination);
|
||||
using (var destination = storage.GetStream(backupFilename, FileAccess.Write, FileMode.CreateNew))
|
||||
source.CopyTo(destination);
|
||||
}
|
||||
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user