1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +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 try
{ {
var resolvedType = Type.GetType(r.InstantiationInfo) var resolvedType = Type.GetType(r.InstantiationInfo);
?? throw new RulesetLoadException(@"Type could not be resolved");
if (resolvedType == null)
{
// ruleset DLL was probably deleted.
r.Available = false;
continue;
}
var instanceInfo = (Activator.CreateInstance(resolvedType) as Ruleset)?.RulesetInfo var instanceInfo = (Activator.CreateInstance(resolvedType) as Ruleset)?.RulesetInfo
?? throw new RulesetLoadException(@"Instantiation failure"); ?? throw new RulesetLoadException(@"Instantiation failure");