From f819ffce2bbb64e2fdba83d130042d084304625c Mon Sep 17 00:00:00 2001 From: MillhioreF Date: Thu, 10 Aug 2017 00:08:39 -0500 Subject: [PATCH] Make the legacy decoder more resilient against leading linebreaks --- osu.Game/Beatmaps/Formats/BeatmapDecoder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs index 1c3eadc91e..234d65eee4 100644 --- a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs @@ -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");