mirror of
https://github.com/ppy/osu
synced 2024-12-26 17:02:59 +00: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);
|
||||
|
||||
using (var zip = ZipArchive.Create())
|
||||
try
|
||||
{
|
||||
zip.AddAllFromDirectory(backupStorage.GetFullPath(string.Empty));
|
||||
zip.SaveTo(Path.Combine(backupStorage.GetFullPath(string.Empty), attachment_filename), new ZipWriterOptions(CompressionType.Deflate));
|
||||
using (var zip = ZipArchive.Create())
|
||||
{
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user