1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 13:23:22 +08:00

Don't throw when a ruleset type is completely missing

This commit is contained in:
Dean Herbert 2022-08-22 14:35:44 +09:00
parent bb46f72f9e
commit 9d31f61ca9

View File

@ -68,8 +68,14 @@ namespace osu.Game.Rulesets
{
try
{
var resolvedType = Type.GetType(r.InstantiationInfo)
?? throw new RulesetLoadException(@"Type could not be resolved");
var resolvedType = Type.GetType(r.InstantiationInfo);
if (resolvedType == null)
{
// ruleset DLL was probably deleted.
r.Available = false;
continue;
}
var instanceInfo = (Activator.CreateInstance(resolvedType) as Ruleset)?.RulesetInfo
?? throw new RulesetLoadException(@"Instantiation failure");