From 5b2af7f264cba42dbb4ad4dababb38a48eff2cf9 Mon Sep 17 00:00:00 2001 From: sw1tchbl4d3 Date: Wed, 13 Sep 2023 12:44:00 +0200 Subject: [PATCH] Default to none bank if invalid samplebank is specified --- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 3dbe7b6519..339e9bb5bc 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -193,10 +193,10 @@ namespace osu.Game.Rulesets.Objects.Legacy var addBank = (LegacySampleBank)Parsing.ParseInt(split[1]); string stringBank = bank.ToString().ToLowerInvariant(); - if (stringBank == @"none") + if (stringBank == @"none" || !Enum.IsDefined(bank)) stringBank = null; string stringAddBank = addBank.ToString().ToLowerInvariant(); - if (stringAddBank == @"none") + if (stringAddBank == @"none" || !Enum.IsDefined(addBank)) stringAddBank = null; bankInfo.BankForNormal = stringBank;