Default to none bank if invalid samplebank is specified

This commit is contained in:
sw1tchbl4d3 2023-09-13 12:44:00 +02:00
parent f90f2491c3
commit 5b2af7f264

View File

@ -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;