mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Make country code parsing resilient to invalid cases
This commit is contained in:
@ -57,7 +57,11 @@ namespace osu.Game.Graphics.Containers.Markdown
|
||||
}
|
||||
|
||||
string flag = flagAttribute.Split('=').Last().Trim('"');
|
||||
AddDrawable(new DrawableFlag(Enum.Parse<CountryCode>(flag)) { Size = new Vector2(20, 15) });
|
||||
|
||||
if (!Enum.TryParse<CountryCode>(flag, out var countryCode))
|
||||
countryCode = CountryCode.Unknown;
|
||||
|
||||
AddDrawable(new DrawableFlag(countryCode) { Size = new Vector2(20, 15) });
|
||||
}
|
||||
|
||||
private class OsuMarkdownInlineCode : Container
|
||||
|
Reference in New Issue
Block a user