From 5d78561aa36fb6dd2cbbdec343b7fcbb63c10683 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 May 2023 21:05:57 +0900 Subject: [PATCH] Remove weird catch logic --- osu.Game/Database/LegacyArchiveExporter.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/osu.Game/Database/LegacyArchiveExporter.cs b/osu.Game/Database/LegacyArchiveExporter.cs index f148d6951d..306ac5f6a4 100644 --- a/osu.Game/Database/LegacyArchiveExporter.cs +++ b/osu.Game/Database/LegacyArchiveExporter.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using System.IO; using System.Linq; using System.Threading; @@ -40,10 +39,8 @@ protected override void ExportToStream(TModel model, Stream outputStream, Progre /// The cancellation token. private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification? notification, CancellationToken cancellationToken = default) { - try + using (var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate))) { - using var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate)); - int i = 0; int fileCount = model.Files.Count(); bool fileMissing = false; @@ -78,14 +75,6 @@ private void exportZipArchive(TModel model, Stream outputStream, ProgressNotific Logger.Log("Some of model files are missing, they will not be included in the archive", LoggingTarget.Database, LogLevel.Error); } } - catch (ObjectDisposedException) - { - // outputStream may close before writing when request cancel. - if (cancellationToken.IsCancellationRequested) - return; - - throw; - } } } }