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:
parent
e4bad93b66
commit
e19f4935c3
@ -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());
|
||||||
|
Loading…
Reference in New Issue
Block a user