mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:42:54 +08:00
Add safety against zip creation potentially failing (probably can't but still)
This commit is contained in:
parent
465e7d29fe
commit
fb081384e1
@ -166,11 +166,15 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
backupStorage.Delete(attachment_filename);
|
backupStorage.Delete(attachment_filename);
|
||||||
|
|
||||||
using (var zip = ZipArchive.Create())
|
try
|
||||||
{
|
{
|
||||||
zip.AddAllFromDirectory(backupStorage.GetFullPath(string.Empty));
|
using (var zip = ZipArchive.Create())
|
||||||
zip.SaveTo(Path.Combine(backupStorage.GetFullPath(string.Empty), attachment_filename), new ZipWriterOptions(CompressionType.Deflate));
|
{
|
||||||
|
zip.AddAllFromDirectory(backupStorage.GetFullPath(string.Empty));
|
||||||
|
zip.SaveTo(Path.Combine(backupStorage.GetFullPath(string.Empty), attachment_filename), new ZipWriterOptions(CompressionType.Deflate));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
backupStorage.PresentFileExternally(attachment_filename);
|
backupStorage.PresentFileExternally(attachment_filename);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user