mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 00:43:21 +08:00
Make the legacy decoder more resilient against leading linebreaks
This commit is contained in:
parent
c16dbc05aa
commit
f819ffce2b
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user