1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 18:52:55 +08:00

Fix incorrect undo logic on exception

This commit is contained in:
Dean Herbert 2019-06-10 14:13:36 +09:00
parent e4bad93b66
commit e19f4935c3

View File

@ -305,8 +305,7 @@ namespace osu.Game.Database
{ {
Logger.Log($"Importing {item}...", LoggingTarget.Database); Logger.Log($"Importing {item}...", LoggingTarget.Database);
if (archive != null) item.Files = archive != null ? createFileInfos(archive, Files) : new List<TFileModel>();
item.Files = createFileInfos(archive, Files);
var localItem = item; var localItem = item;
@ -314,7 +313,7 @@ namespace osu.Game.Database
{ {
await Populate(item, archive, cancellationToken); await Populate(item, archive, cancellationToken);
} }
finally catch (Exception)
{ {
if (!Delete(localItem)) if (!Delete(localItem))
Files.Dereference(localItem.Files.Select(f => f.FileInfo).ToArray()); Files.Dereference(localItem.Files.Select(f => f.FileInfo).ToArray());