mirror of https://github.com/ppy/osu
Fix event flushing sticking on early return
This commit is contained in:
parent
4a18951cce
commit
31ab6f2408
|
@ -174,7 +174,7 @@ public void Import(params string[] paths)
|
|||
/// <param name="archive">The archive to be imported.</param>
|
||||
public TModel Import(ArchiveReader archive)
|
||||
{
|
||||
TModel item;
|
||||
TModel item = null;
|
||||
delayEvents();
|
||||
|
||||
try
|
||||
|
@ -211,9 +211,12 @@ public TModel Import(ArchiveReader archive)
|
|||
Logger.Error(e, $"Import of {archive.Name} failed and has been rolled back.", LoggingTarget.Database);
|
||||
item = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// we only want to flush events after we've confirmed the write context didn't have any errors.
|
||||
flushEvents(item != null);
|
||||
}
|
||||
|
||||
// we only want to flush events after we've confirmed the write context didn't have any errors.
|
||||
flushEvents(item != null);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue