1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +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 get
{ {
if (modsString == null)
return Array.Empty<Mod>();
var deserialized = JsonConvert.DeserializeObject<string[]>(modsString); var deserialized = JsonConvert.DeserializeObject<string[]>(modsString);
return Ruleset.CreateInstance().GetAllMods().Where(mod => deserialized.Any(d => d == mod.ShortenedName)).ToArray(); return Ruleset.CreateInstance().GetAllMods().Where(mod => deserialized.Any(d => d == mod.ShortenedName)).ToArray();
} }