mirror of
https://github.com/osukey/osukey.git
synced 2025-06-19 02:07:55 +09: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
|
try
|
||||||
{
|
{
|
||||||
using (var source = storage.GetStream(Filename, mode: FileMode.Open))
|
using (var source = storage.GetStream(Filename, mode: FileMode.Open))
|
||||||
using (var destination = storage.GetStream(backupFilename, FileAccess.Write, FileMode.CreateNew))
|
|
||||||
{
|
{
|
||||||
// source may not exist.
|
// source may not exist.
|
||||||
if (source == null)
|
if (source == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
source.CopyTo(destination);
|
using (var destination = storage.GetStream(backupFilename, FileAccess.Write, FileMode.CreateNew))
|
||||||
|
source.CopyTo(destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user