mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 21:25:36 +08:00
Softly handle errors when no beatmap file exists in archive
This commit is contained in:
parent
27c151db8f
commit
99574ecad8
@ -352,9 +352,8 @@ namespace osu.Game.Beatmaps
|
|||||||
string mapName = reader.Filenames.FirstOrDefault(f => f.EndsWith(".osu"));
|
string mapName = reader.Filenames.FirstOrDefault(f => f.EndsWith(".osu"));
|
||||||
if (string.IsNullOrEmpty(mapName))
|
if (string.IsNullOrEmpty(mapName))
|
||||||
{
|
{
|
||||||
// Todo: This is temporary for debugging purposes
|
Logger.Log($"No beatmap files found in the beatmap archive ({reader.Name}). Skipping.");
|
||||||
var files = reader.Filenames.ToList();
|
return null;
|
||||||
throw new InvalidOperationException($"No beatmap files found in this beatmap archive. Files ({files.Count}): {string.Join(", ", files)}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Beatmap beatmap;
|
Beatmap beatmap;
|
||||||
|
@ -178,7 +178,8 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return Import(CreateModel(archive), archive);
|
var model = CreateModel(archive);
|
||||||
|
return model == null ? null : Import(model, archive);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user