diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 353959582b..2493dab08c 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -611,9 +611,9 @@ protected override void ParseFile(StreamReader stream, Beatmap beatmap) CommandTimelineGroup timelineGroup = null; string line; - while ((line = stream.ReadLine()?.Trim()) != null) + while ((line = stream.ReadLine()) != null) { - if (string.IsNullOrEmpty(line)) + if (string.IsNullOrWhiteSpace(line)) continue; if (line.StartsWith("//")) @@ -679,10 +679,12 @@ protected override void ParseFile(StreamReader stream, Beatmap beatmap) private KeyValuePair splitKeyVal(string line, char separator) { + var split = line.Trim().Split(new[] { separator }, 2); + return new KeyValuePair ( - line.Remove(line.IndexOf(separator)).Trim(), - line.Substring(line.IndexOf(separator) + 1).Trim() + split[0].Trim(), + split.Length > 1 ? split[1].Trim() : string.Empty ); }