mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Gracefully handle missing type rather than triggering ArgumentNullException
This commit is contained in:
@ -129,13 +129,18 @@ namespace osu.Game.Rulesets
|
||||
{
|
||||
try
|
||||
{
|
||||
var instanceInfo = ((Ruleset)Activator.CreateInstance(Type.GetType(r.InstantiationInfo).AsNonNull())).RulesetInfo;
|
||||
var resolvedType = Type.GetType(r.InstantiationInfo);
|
||||
|
||||
r.Name = instanceInfo.Name;
|
||||
r.ShortName = instanceInfo.ShortName;
|
||||
r.InstantiationInfo = instanceInfo.InstantiationInfo;
|
||||
if (resolvedType != null)
|
||||
{
|
||||
var instanceInfo = ((Ruleset)Activator.CreateInstance(resolvedType)).RulesetInfo;
|
||||
|
||||
r.Available = true;
|
||||
r.Name = instanceInfo.Name;
|
||||
r.ShortName = instanceInfo.ShortName;
|
||||
r.InstantiationInfo = instanceInfo.InstantiationInfo;
|
||||
|
||||
r.Available = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
Reference in New Issue
Block a user