From c16dbc05aafc2881cce98f78ddf9afce210df474 Mon Sep 17 00:00:00 2001 From: MillhioreF Date: Wed, 9 Aug 2017 23:41:22 -0500 Subject: [PATCH] Add new error for malformed (too many variables) hit objects during import --- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index a4c319291c..b02a582bec 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -20,6 +20,9 @@ namespace osu.Game.Rulesets.Objects.Legacy public override HitObject Parse(string text) { string[] split = text.Split(','); + if (split.Length > 11) + throw new InvalidOperationException("One or more hit objects were malformed."); + ConvertHitObjectType type = (ConvertHitObjectType)int.Parse(split[3]) & ~ConvertHitObjectType.ColourHax; bool combo = type.HasFlag(ConvertHitObjectType.NewCombo); type &= ~ConvertHitObjectType.NewCombo;