1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:42:56 +08:00

Merge pull request #2342 from smoogipoo/fix-formatexception-beatmap

Handle possible FormatException when parsing timing points
This commit is contained in:
Dean Herbert 2018-04-02 20:20:35 +09:00 committed by GitHub
commit 25524bf24f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,13 +81,13 @@ namespace osu.Game.Beatmaps.Formats
handleDifficulty(line);
return;
case Section.Events:
handleEvents(line);
handleEvent(line);
return;
case Section.TimingPoints:
handleTimingPoints(line);
handleTimingPoint(line);
return;
case Section.HitObjects:
handleHitObjects(line);
handleHitObject(line);
return;
}
@ -246,7 +246,7 @@ namespace osu.Game.Beatmaps.Formats
}
}
private void handleEvents(string line)
private void handleEvent(string line)
{
string[] split = line.Split(',');
@ -275,7 +275,9 @@ namespace osu.Game.Beatmaps.Formats
}
}
private void handleTimingPoints(string line)
private void handleTimingPoint(string line)
{
try
{
string[] split = line.Split(',');
@ -360,8 +362,12 @@ namespace osu.Game.Beatmaps.Formats
});
}
}
catch (FormatException e)
{
}
}
private void handleHitObjects(string line)
private void handleHitObject(string line)
{
// If the ruleset wasn't specified, assume the osu!standard ruleset.
if (parser == null)