mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 16:02:56 +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)
|
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))
|
if (line == null || !decoders.ContainsKey(line))
|
||||||
throw new IOException(@"Unknown file format");
|
throw new IOException(@"Unknown file format");
|
||||||
|
Loading…
Reference in New Issue
Block a user