1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 11:27:24 +08:00

Make the legacy decoder more resilient against leading linebreaks

This commit is contained in:
MillhioreF 2017-08-10 00:08:39 -05:00
parent c16dbc05aa
commit f819ffce2b

View File

@ -19,7 +19,9 @@ namespace osu.Game.Beatmaps.Formats
public static BeatmapDecoder GetDecoder(StreamReader stream)
{
string line = stream.ReadLine()?.Trim();
string line;
do { line = stream.ReadLine()?.Trim(); }
while (line != null && line.Length == 0);
if (line == null || !decoders.ContainsKey(line))
throw new IOException(@"Unknown file format");