mirror of
https://github.com/osukey/osukey.git
synced 2025-06-25 05:07:59 +09:00
Improve handling of null models when importing
This commit is contained in:
parent
15c75b4442
commit
ef2e93d5c7
@ -160,7 +160,8 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
lock (imported)
|
lock (imported)
|
||||||
{
|
{
|
||||||
imported.Add(model);
|
if (model != null)
|
||||||
|
imported.Add(model);
|
||||||
current++;
|
current++;
|
||||||
|
|
||||||
notification.Text = $"Imported {current} of {paths.Length} {HumanisedModelName}s";
|
notification.Text = $"Imported {current} of {paths.Length} {HumanisedModelName}s";
|
||||||
@ -243,7 +244,7 @@ namespace osu.Game.Database
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="archive">The archive to be imported.</param>
|
/// <param name="archive">The archive to be imported.</param>
|
||||||
/// <param name="cancellationToken">An optional cancellation token.</param>
|
/// <param name="cancellationToken">An optional cancellation token.</param>
|
||||||
public Task<TModel> Import(ArchiveReader archive, CancellationToken cancellationToken = default)
|
public async Task<TModel> Import(ArchiveReader archive, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
@ -267,7 +268,7 @@ namespace osu.Game.Database
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Import(model, archive, cancellationToken);
|
return await Import(model, archive, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user