1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-24 15:42:11 +08:00

Add a better error message for corrupt maps with no .osu files

This commit is contained in:
MillhioreF
2017-08-09 23:27:13 -05:00
Unverified
parent 10321497ca
commit a8cf7ff93a
+10
View File
@@ -307,6 +307,16 @@ namespace osu.Game.Beatmaps
/// <returns>The imported beatmap, or an existing instance if it is already present.</returns>
private BeatmapSetInfo importToStorage(ArchiveReader reader)
{
// let's make sure there are actually .osu files to import.
try
{
string mapName = reader.Filenames.First(f => f.EndsWith(".osu"));
}
catch
{
throw new InvalidOperationException("No beatmap files found in the map folder.");
}
// for now, concatenate all .osu files in the set to create a unique hash.
MemoryStream hashable = new MemoryStream();
foreach (string file in reader.Filenames.Where(f => f.EndsWith(".osu")))