1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Fix crash when loading scores with no mods

This commit is contained in:
smoogipoo 2018-11-29 18:29:25 +09:00
parent d2f0a921ca
commit aa7f66b24a

View File

@ -43,6 +43,9 @@ namespace osu.Game.Scoring
{
get
{
if (modsString == null)
return Array.Empty<Mod>();
var deserialized = JsonConvert.DeserializeObject<string[]>(modsString);
return Ruleset.CreateInstance().GetAllMods().Where(mod => deserialized.Any(d => d == mod.ShortenedName)).ToArray();
}