Merge pull request #1342 from smoogipoo/fix-storyboard-exception

Fix trimming too early in OsuLegacyDecoder crashing storyboards
This commit is contained in:
Dean Herbert 2017-10-11 13:04:41 +09:00 committed by GitHub
commit 6542079385
1 changed files with 6 additions and 4 deletions

View File

@ -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<string, string> splitKeyVal(string line, char separator)
{
var split = line.Trim().Split(new[] { separator }, 2);
return new KeyValuePair<string, string>
(
line.Remove(line.IndexOf(separator)).Trim(),
line.Substring(line.IndexOf(separator) + 1).Trim()
split[0].Trim(),
split.Length > 1 ? split[1].Trim() : string.Empty
);
}